AttentionThis page documents an earlier version. Go to the latest (v2.0)version.
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
keydoes not exist, the given
valueis inserted for the
key, and null is returned.
keyis associated with non-string data, an error is raised.
Returns the old value of the given
$ SET yugakey 1
$ GETSET yugakey 2