HPERSIST

Syntax
HPERSIST 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,

Remove the existing expiration on a hash key's field(s), turning the field(s) from volatile (a field with expiration set) to persistent (a field that will never expire as no TTL (time to live) is associated).

Examples

redis> HSET mykey field1 "hello" field2 "world"
(integer 2)
redis> HEXPIRE mykey 300 FIELDS 2 field1 field2
1) (integer) 1
2) (integer) 1
redis> HTTL mykey FIELDS 2 field1 field2
1) (integer) 283
2) (integer) 283
redis> HPERSIST mykey FIELDS 1 field2
1) (integer) 1
redis> HTTL mykey FIELDS 2 field1 field2
1) (integer) 268
2) (integer) -1

RESP2/RESP3 replies

One of the following:


RATE THIS PAGE
Back to top ↑