RenamenxCommand: Contents
  RENAMENX _oldkey_ _newkey_
    Return value
    See also

RenamenxCommand

RENAMENX _oldkey_ _newkey_

Time complexity: O(1)
Rename oldkey into newkey but fails if the destination key newkey already exists.

Return value

Integer reply, specifically:

1 if the key was renamed
0 if the target key already exist
-1 if the source key does not exist
-3 if source and destination keys are the same

See also

  • RENAME is like RENAMENX but overwrite existing destionation key.