Redis Set SISMEMBER Command
The Redis SISMEMBER
command checks if a given element is a member of the set.
Syntax
The basic syntax of the SISMEMBER
command is as follows:
1 | SISMEMBER key member |
It returns if member
is a member of the set stored at key
.
Available Since
Redis version >= 1.0.0
Time Complexity
O(1)
ACL Categories
@read
, @set
, @fast
Return Value
0
if the element is not a member of the set, or when the key does not exist.1
if the element is a member of the set.
Example
1 | 127.0.0.1:6379> SADD key1 a b c d |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.