Skip to content

GETSET

GETSET key value

GETSET sets the value for the key and returns the old value.

The command returns "" if the key does not exist.

localhost:7379> SET k1 v1
OK
localhost:7379> GETSET k1 v2
OK "v1"
localhost:7379> GET k1
OK "v2"