PSETEX

Stores a string with an expiry measured in milliseconds.

Strings · Example verified

Syntax covered here

PSETEX key milliseconds value

PTTL verifies that the replacement string has a remaining lifetime within the requested duration.

Tested example & replies

Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.

# connection: default
> SET greeting hello
"OK"
# connection: default
> PSETEX greeting 60000 world
"OK"
# connection: default
> PTTL greeting
60000