diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-03-21 10:28:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:16:53 +0000 |
commit | 06cba6ccd165ca8b224797e37fccb9e63f026d77 (patch) | |
tree | e82f1bc439997ae296f2e74f8a64d84c5d95f140 /iredis/data/commands/exists.md | |
parent | Initial commit. (diff) | |
download | iredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.tar.xz iredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.zip |
Adding upstream version 1.9.1.upstream/1.9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/data/commands/exists.md')
-rw-r--r-- | iredis/data/commands/exists.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/iredis/data/commands/exists.md b/iredis/data/commands/exists.md new file mode 100644 index 0000000..83c2043 --- /dev/null +++ b/iredis/data/commands/exists.md @@ -0,0 +1,33 @@ +Returns if `key` exists. + +Since Redis 3.0.3 it is possible to specify multiple keys instead of a single +one. In such a case, it returns the total number of keys existing. Note that +returning 1 or 0 for a single key is just a special case of the variadic usage, +so the command is completely backward compatible. + +The user should be aware that if the same existing key is mentioned in the +arguments multiple times, it will be counted multiple times. So if `somekey` +exists, `EXISTS somekey somekey` will return 2. + +@return + +@integer-reply, specifically: + +- `1` if the key exists. +- `0` if the key does not exist. + +Since Redis 3.0.3 the command accepts a variable number of keys and the return +value is generalized: + +- The number of keys existing among the ones specified as arguments. Keys + mentioned multiple times and existing are counted multiple times. + +@examples + +```cli +SET key1 "Hello" +EXISTS key1 +EXISTS nosuchkey +SET key2 "World" +EXISTS key1 key2 nosuchkey +``` |