newkey does not yet exist.
It returns an error when
key does not exist.
Note: Before Redis 3.2.0, an error is returned if source and destination names are the same.
Integer reply, specifically:
keywas renamed to
redis> SET mykey "Hello"
OKredis> SET myotherkey "World"
OKredis> RENAMENX mykey myotherkey
(integer) 0redis> GET myotherkey