What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.
HPTTL
Returns the remaining time to live in milliseconds of a hash key's field(s) that have an associated expiration.
Usage
HPTTL key FIELDS fields
Complexity
O(N) where N is the number of specified fields.
Since
9.0.0
ACL Categories
@fast, @hash, @read
Command flags
READONLY, FAST
Like HTTL this command returns the remaining time to live of hash field(s) that has an associated expiration time,
with the sole difference that HTTL returns the amount of remaining
time in seconds while HPTTL returns it in milliseconds.
See also the HTTL command that returns the same information with seconds resolution.
Array reply: a list of values associated with the result of getting the remaining time-to-live of the specific fields, in the same order as they are requested.
-2: Field does not exist in the provided hash key, or the hash key is empty.
-1: Field exists in the provided hash key, but has no expiration associated with it.
Integer: The expiration time associated with the hash key field, in milliseconds.
RESP3
Array reply: a list of values associated with the result of getting the remaining time-to-live of the specific fields, in the same order as they are requested.
-2: Field does not exist in the provided hash key, or the hash key is empty.
-1: Field exists in the provided hash key, but has no expiration associated with it.
Integer: The expiration time associated with the hash key field, in milliseconds.