TOUCH
Syntax
TOUCH keys [key ...]
Module
genericCategories
keyspace read fastDescription
Alters the last access time or access count of the key(s) depending on whether LFU or LRU strategy was used. A key is ignored if it does not exist. This commands returns the number of keys that were touched.
Examples
- Go (Embedded)
- CLI
Touch a key:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
touched, err := db.Touch("key1")
Touch multiple keys:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
touched, err := db.Touch("key1", "key2", "key3")
Touch a key:
> TOUCH key1
Touch multiple keys:
> TOUCH key1 key2 key3