答案 0 :(得分:1)
RENAMENX
(如果新密钥不存在则重命名),如果新密钥(要重命名为)存在,则会抛出错误。
Case1:
- Key renamed to new key.
Case2 (Existing new key):
- Error, new key exists.
文档显示的RENAME
命令会将密钥重命名为新密钥(要重命名为),即使它存在,强制 a DEL
。< / p>
Case1:
- Key renamed to new key.
Case2 (Existing new key):
- New Key exists.
- Delete New Key and its value.
- Key renamed.