HEXPIREAT · Valkey

HEXPIREAT

Set expiry time on hash fields.

Usage

HEXPIREAT key unix-time-seconds [NX | XX | GT | LT] FIELDS numfields field [field…]

Description

HEXPIREAT has the same effect and semantic as HEXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970). A timestamp in the past will delete the key immediately.

For the specific semantics of the command refer to the documentation of HEXPIRE.

Options

The HEXPIREAT command supports a set of options that modify its behavior:

Reply

Array reply: a list of integer codes indicating the result of setting expiry on each specified field, in the same order as the fields are requested.

Complexity

O(N) where N is the number of specified fields.

ACL Categories

@fast @hash @write

Examples

127.0.0.1:6379> HSET myhash f1 v1 f2 v2 f3 v3
(integer) 3
27.0.0.1:6379> HEXPIREAT myhash 1754846600 FIELDS 2 f2 f3
1) (integer) 1
2) (integer) 1
127.0.0.1:6379> HEXPIRETIME myhash FIELDS 3 f1 f2 f3
1) (integer) -1
2) (integer) 1754846600
3) (integer) 1754846600

History

See also

HDEL, HEXISTS, HEXPIRE, HEXPIRETIME, HGET, HGETALL, HGETEX, HINCRBY, HINCRBYFLOAT, HKEYS, HLEN, HMGET, HMSET, HPERSIST, HPEXPIRE, HPEXPIREAT, HPEXPIRETIME, HPTTL, HRANDFIELD, HSCAN, HSET, HSETEX, HSETNX, HSTRLEN, HTTL, HVALS.