Redis Set SMISMEMBER Command
The Redis SMISMEMBER
command returns whether each member is a member of the set stored at key. For every member,
- 1 is returned if the value is a member of the set,
- or 0 if the element is not a member of the set or if key does not exist.
Syntax
The basic syntax of the SMISMEMBER
command is as follows:
1 | SMISMEMBER key member [member ...] |
Available Since
Redis version >= 6.2.0
Time Complexity
O(N) where N is the number of elements being checked for membership
ACL Categories
@read
, @set
, @fast
Return Value
Returns a list representing the membership of the given elements, in the same order as they are requested.
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.