Skip to main content

HTTL

Syntax

HTTL key FIELDS numfields field [field...]

Module

hash

Categories

fast hash read

Description

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

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)