Upstash Documentation

PEXPIRE

Sets a timeout on key. After the timeout has expired, the key will automatically be deleted.
1 min read

Arguments#

keystrrequired#

The key to expire.

milliseconds | datetime.timedeltaintrequired#

The timeout in milliseconds as int or datetime.timedelta

nxbool#

Set expiry only when the key has no expiry

xxbool#

Set expiry only when the key has an existing expiry

gtbool#

Set expiry only when the new expiry is greater than current one

ltbool#

Set expiry only when the new expiry is less than current one

Response#