HPTTL

Syntax
HPTTL key FIELDS numfields field [field ...]
Available since:
7.4.0
Time complexity:
O(N) where N is the number of arguments to the command
ACL categories:
@read, @hash, @fast,

Like HTTL, this command returns the remaining TTL (time to live) of a field that has an expiration set, but in milliseconds instead of seconds.

Example

redis> HPTTL no-key 10 FIELDS 3 field1 field2 field3
(nil)
redis> HSET mykey field1 "hello" field2 "world"
(integer) 2
redis> HEXPIRE mykey 300 FIELDS 2 field1 field3
1) (integer) 1
2) (integer) -2
redis> HPTTL mykey FIELDS 3 field1 field2 field3
1) (integer) 292202
2) (integer) -1
3) (integer) -2

RESP2/RESP3 replies

One of the following:


RATE THIS PAGE
Back to top ↑