Generic
PEXPIRE
Sets a timeout on key. After the timeout has expired, the key will automatically be deleted.
Arguments
key
str
requiredThe key to expire.
milliseconds | datetime.timedelta
int
requiredThe timeout in milliseconds as int or datetime.timedelta
nx
bool
Set expiry only when the key has no expiry
xx
bool
Set expiry only when the key has an existing expiry
gt
bool
Set expiry only when the new expiry is greater than current one
lt
bool
Set expiry only when the new expiry is less than current one
Response
True
if the timeout was set