What is the usage of the Redis GETSET command?
The GETSET command is used to set the value of a specific key and return the old value of the key. If the key does not exist, a new value is set and nil is returned.
Grammar:
GETSET key value
They found evidence that supported their initial hypothesis.
Paraphrased: They discovered proof that validated their original assumption.
SET mykey "Hello"
GETSET mykey "World"
GET mykey
In the example above, the value of the key mykey is first set to Hello, then using the GETSET command, the value of the key mykey is set to World and the old value Hello is returned. Finally, using the GET command again to get the value of the key mykey, the output result is World.