const oldValue = await redis.getset("key", newValue);

Arguments

key
string
required
The key to get.
newValue
required
The new value to store.

Response

The response is the value stored at the key or null if the key doesn’t exist.

const oldValue = await redis.getset("key", newValue);