RENAME key newkey
Time complexity: O(1)
In Cluster mode, both and newkey
must be in the same hash slot, meaning that in practice only keys that have the same hash tag can be reliably renamed in cluster.
redis> SET mykey "Hello"
redis> GET myotherkey