Upstash Documentation

EXPIRE

Sets a timeout on key. The key will automatically be deleted.
1 min read

Arguments#

keystrrequired#

The key to set the timeout on.

secondsint | datetime.timedeltarequired#

The timeout in seconds as int or datetime.timedelta object

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#