Skip to main content

Arguments

str
required
The key
TValue
required
The value, if this is not a string, we will use JSON.stringify to convert it to a string.
bool
Instead of returning True, this will cause the command to return the old value stored at key, or None when key did not exist.
int
Sets an expiration (in seconds) to the key.
int
Sets an expiration (in milliseconds) to the key.
int
Set the UNIX timestamp in seconds until the key expires.
int
Set the UNIX timestamp in milliseconds until the key expires.
bool
Keeps the old expiration if the key already exists.
bool
Only set the key if it does not already exist.
bool
Only set the key if it already exists.

Response

True if the key was set. If get is specified, this will return the old value stored at key, or None when the key did not exist.