String
GETSET
Return the value of the specified key and replace it with a new value.
Arguments
keybodystringrequired
The key to get.
newValuebodyrequired
The new value to store.
Response
required
The response is the value stored at the key or null if the key doesn't exist.
Example
const oldValue = await redis.getset("key", newValue);