RENAMENX key newkey
Time complexity: O(1)
Renames to newkey
if newkey
does not yet exist. It returns an error when key
does not exist.
Integer reply, specifically:
1
if was renamed tonewkey
.
redis> SET mykey "Hello"
redis> RENAMENX mykey myotherkey
redis> GET myotherkey