修改本页
Redis

RENAMENX key newkey

Renames key to newkey if newkey does not yet exist. It returns an error under the same conditions as RENAME.

返回值

Integer reply, specifically:

例子

redis>  SET mykey "Hello"
OK
redis>  SET myotherkey "World"
OK
redis>  RENAMENX mykey myotherkey
(integer) 0
redis>  GET myotherkey
"World"
redis> 
Comments powered by Disqus