Arguments
The value, if this is not a string, we will use JSON.stringify
to convert it
to a string.
You can pass a few options to the command.
Instead of returning "OK"
, this will cause the command to return the old
value stored at key, or null
when key did not exist.
Adds an expiration (in seconds) to the key.
Adds an expiration (in milliseconds) to the key.
Expires the key after the given timestamp (in seconds).
Expires the key after the given timestamp (in milliseconds).
Keeps the old expiration if the key already exists.
Only set the key if it does not already exist.
Only set the key if it already exists.
Response
await redis.set("my-key", {my: "value"});