HTTL
Syntax
HTTL key FIELDS numfields field [field...]
Module
hashCategories
fast hash readDescription
Returns the remaining TTL (time to live) of a hash key's field(s) that have a set expiration. This introspection capability allows you to check how many seconds a given hash field will continue to be part of the hash key.
Examples
- Go (Embedded)
- CLI
Get the expiration time in seconds for fields in the hash:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
TTLArray, err := db.HTTL("key", field1, field2)
Get the expiration time in seconds for fields in the hash:
> HTTL key FIELDS 2 field1 field2