Redis

RENAME key newkey

Renames key to newkey. It returns an error when the source and destination names are the same, or when key does not exist. If newkey already exists it is overwritten.

Return value

Status code reply

Examples

redis>  SET mykey "Hello"
OK
redis>  RENAME mykey myotherkey
OK
redis>  GET myotherkey
"Hello"
redis> 
Comments powered by Disqus