RENAMENX key newkey

#Example

redis> SET mykey "Hello"
"OK"
redis> SET myotherkey "World"
"OK"
redis> RENAMENX mykey myotherkey
(integer) 0
redis> GET myotherkey
"World"

Rename a key, only if the new key does not exist

Comments