smismember.3valkey - Man Page

Determines whether multiple members belong to a set.

Synopsis

SMISMEMBER key member [member...]

Description

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.

Reply

valkey-protocol(7) Array reply: a list representing the membership of the given elements, in the same order as they are requested.

Complexity

O(N) where N is the number of elements being checked for membership

Acl Categories

@fast @read @set

History

Examples

127.0.0.1:6379> SADD myset "one"
(integer) 1
127.0.0.1:6379> SADD myset "one"
(integer) 0
127.0.0.1:6379> SMISMEMBER myset "one" "notamember"
1) (integer) 1
2) (integer) 0

See Also

sadd(3valkey), scard(3valkey), sdiff(3valkey), sdiffstore(3valkey), sinter(3valkey), sintercard(3valkey), sinterstore(3valkey), sismember(3valkey), smembers(3valkey), smove(3valkey), spop(3valkey), srandmember(3valkey), srem(3valkey), sscan(3valkey), sunion(3valkey), sunionstore(3valkey)

Info

2024-09-23 8.0.0 Valkey Command Manual