GETSET
Synopsis
GETSET key value
This command is an atomic read and write operation that gets the existing value that is associated with the given key
while rewriting it with the given value
.
Return Value
Returns the old value of the given key
.
Examples
$ SET yugakey 1
"OK"
$ GETSET yugakey 2
1