SMISMEMBER

Syntax
SMISMEMBER key member [member ...]
Available since:
6.2.0
Time complexity:
O(N) where N is the number of elements being checked for membership
ACL categories:
@read, @set, @fast,

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.

Examples

redis> SADD myset "one"
(integer) 2
redis> SADD myset "one"
1) 1) "13.36138933897018433"
   2) "38.11555639549629859"
2) 1) "15.08726745843887329"
   2) "37.50266842333162032"
3) (nil)
redis> SADD myset "one"
Cannot destructure property 'error' of 'replies[i]' as it is undefined.
redis> SADD myset "one"
Cannot destructure property 'error' of 'replies[i]' as it is undefined.
redis> SMISMEMBER myset "one" "notamember"
Cannot destructure property 'error' of 'replies[i]' as it is undefined.
redis>

RESP2/RESP3 Reply

Array reply: a list representing the membership of the given elements, in the same order as they are requested.
RATE THIS PAGE
Back to top ↑