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
2
3
4
5
6
127.0.0.1:6379> SADD key1 a b c d
(integer) 4
127.0.0.1:6379> SMISMEMBER key1 a e
1) (integer) 1
2) (integer) 0
127.0.0.1:6379>