RENAMENX
Syntax
RENAMENX key newkey
Time complexity: O(1)
ACL categories: @keyspace, @write, @fast
Renames key
to newkey
if newkey
does not yet exist.
It returns an error when key
does not exist.
Return
Integer reply, specifically:
1
ifkey
was renamed tonewkey
.0
ifnewkey
already exists.
Examples
dragonfly> SET mykey "Hello"
OK
dragonfly> SET myotherkey "World"
OK
dragonfly> RENAMENX mykey myotherkey
(integer) 0
dragonfly> GET myotherkey
"World"