method
RedisClient.set
The key to set
The value to set. A number is sent as the string that String(value) returns.
Promise that resolves with "OK" on success
The key to set
The value to set. A number is sent as the string that String(value) returns.
Set the specified expire time, in seconds
Promise that resolves with "OK" on success
The key to set
The value to set. A number is sent as the string that String(value) returns.
Set the specified expire time, in milliseconds
Promise that resolves with "OK" on success
Set key to hold the string value with expiration at a specific Unix timestamp
The key to set
The value to set. A number is sent as the string that String(value) returns.
Set the specified Unix time at which the key will expire, in seconds
Promise that resolves with "OK" on success
Set key to hold the string value with expiration at a specific Unix timestamp
The key to set
The value to set. A number is sent as the string that String(value) returns.
Set the specified Unix time at which the key will expire, in milliseconds
Promise that resolves with "OK" on success
The key to set
The value to set. A number is sent as the string that String(value) returns.
Only set the key if it does not already exist
Promise that resolves with "OK" on success, or null if the key already exists
The key to set
The value to set. A number is sent as the string that String(value) returns.
Only set the key if it already exists
Promise that resolves with "OK" on success, or null if the key does not exist
The key to set
The value to set. A number is sent as the string that String(value) returns.
Return the old string stored at key, or null if key did not exist
Promise that resolves with the old value, or null if key did not exist
The key to set
The value to set. A number is sent as the string that String(value) returns.
Retain the time to live associated with the key
Promise that resolves with "OK" on success
Set key to hold the string value with several options
The key to set
The value to set. A number is sent as the string that String(value) returns.
The first option (EX, PX, EXAT, PXAT, NX, XX, KEEPTTL, GET)
The options that follow, and their values
Promise that resolves with "OK" on success, null if NX/XX condition not met, or the old value if GET is specified
await redis.set("lock", "token", "NX", "PX", 30_000);Set key to hold the string value with various options
The key to set
The value to set. A number is sent as the string that String(value) returns.
Array of options (EX, PX, EXAT, PXAT, NX, XX, KEEPTTL, GET)
Promise that resolves with "OK" on success, null if NX/XX condition not met, or the old value if GET is specified