RENAMENX
Renames a key only when the destination does not exist.
Keys & expiration · Example verified
Syntax covered here
RENAMENX source destinationThe verified path uses an unused destination and reports a successful rename.
Tested example & replies
Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.
# connection: default
> SET sample value
"OK"
# connection: default
> RENAMENX sample renamed
1