Sets the expiration time of one or more hash fields in milliseconds.
HPEXPIRE key
milliseconds [NX |
[XX] [GT |
LT]] FIELDS
numfields field [field…]
This command works exactly like HEXPIRE but the time to live of the
field(s) is specified in milliseconds instead of seconds. Note, that
providing a millisecond time of ‘0’ will cause immediate expiration and
reclamation of the field(s).
The HPEXPIRE command supports a set of options that
modify its behavior:
Array of integer codes indicating the result of setting expiry on each specified field, in the same order as the fields are requested.
O(N) where N is the number of specified fields.
@fast @hash @write
127.0.0.1:6379> HSET myhash f1 v1 f2 v2 f3 v3
(integer) 3
127.0.0.1:6379> HPEXPIRE myhash 10000 FIELDS 2 f2 f3
1) (integer) 1
2) (integer) 1
127.0.0.1:6379> HPTTL myhash FIELDS 3 f1 f2 f3
1) (integer) -1
2) (integer) 9597
3) (integer) 9597
HDEL, HEXISTS, HEXPIRE, HEXPIREAT, HEXPIRETIME, HGET, HGETALL, HGETDEL, HGETEX, HINCRBY, HINCRBYFLOAT, HKEYS, HLEN, HMGET, HMSET, HPERSIST, HPEXPIREAT, HPEXPIRETIME, HPTTL, HRANDFIELD, HSCAN, HSET, HSETEX, HSETNX, HSTRLEN, HTTL, HVALS.