Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

NEXPIREAT

Last updated
NEXPIREAT key unix-time-nanoseconds
Group
Keys
Complexity
O(1)
Arity
3 (exactly, counting the command name)
Flags
write, fast
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

NEXPIREAT sets the moment key expires as an absolute Unix timestamp in nanoseconds. It always replaces the current time to live. A timestamp that is already in the past makes the key expire at once.

Case RESP2 RESP3
The time was set Integer 1 Integer 1
The key does not exist Integer 0 Integer 0

ERR value is not an integer or out of range when the timestamp is not a 64-bit integer.

127.0.0.1:6379> SET report "q3"
OK
127.0.0.1:6379> NEXPIREAT report 1893456000000000000
(integer) 1
127.0.0.1:6379> PEXPIRETIME report
(integer) 1893456000000

HotKV-only command. Unlike EXPIREAT, it takes no NX, XX, GT or LT options and does not publish an expire keyspace event.

NEXPIRE, NTTL, PEXPIREAT, EXPIREAT