RENAME

Since 1.1.0Keys

Syntax

RENAME source destination
  • Flags: write
  • ACL categories: @generic, @keyspace, @slow, @write
  • Arity: 3

Renames source to destination, with its expiry. If destination exists, it is replaced.

Reply

  • OK.
  • ERR no such key if source does not exist.

Examples

> SET r v EX 100
OK
> RENAME r r2
OK
> TTL r2
(integer) 100
> RENAME nope x
(error) ERR no such key