Return the value of the specified key and replace it with a new value.
redis.set("key", "old-value") assert redis.getset("key", "newvalue") == "old-value"
The key to get.
The new value to store.
The response is the value stored at the key or None if the key doesn’t exist.
None
Was this page helpful?