From 06cba6ccd165ca8b224797e37fccb9e63f026d77 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 21 Mar 2020 11:28:17 +0100 Subject: Adding upstream version 1.9.1. Signed-off-by: Daniel Baumann --- iredis/data/commands/renamenx.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 iredis/data/commands/renamenx.md (limited to 'iredis/data/commands/renamenx.md') diff --git a/iredis/data/commands/renamenx.md b/iredis/data/commands/renamenx.md new file mode 100644 index 0000000..8f98ec5 --- /dev/null +++ b/iredis/data/commands/renamenx.md @@ -0,0 +1,27 @@ +Renames `key` to `newkey` if `newkey` does not yet exist. It returns an error +when `key` does not exist. + +In Cluster mode, both `key` 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. + +@history + +- `<= 3.2.0`: Before Redis 3.2.0, an error is returned if source and destination + names are the same. + +@return + +@integer-reply, specifically: + +- `1` if `key` was renamed to `newkey`. +- `0` if `newkey` already exists. + +@examples + +```cli +SET mykey "Hello" +SET myotherkey "World" +RENAMENX mykey myotherkey +GET myotherkey +``` -- cgit v1.2.3