SMISMEMBER(3valkey)
π SMISMEMBER β the valkey command manual, but make it bestie π
okay so welcome to the SMISMEMBER page of the valkey command manual, bestie π this is a 3valkey manual page and it's about to tell you, in the cutest way possible, whether a whole lil squad of members belongs to a set. no cap.
β¨ NAME β¨
smismember β determines whether multiple members belong to a set. like, plural. multiple. a whole group chat of members. π
β¨ SYNOPSIS β¨
SMISMEMBER key member [member...]
one key, then as many members as your heart desires. [member...] means keep going, girl, keep going π
β¨ DESCRIPTION β¨
Returns whether each member is a member of the set stored at key. that's it, that's the whole vibe check π¦
For every member:
1gets returned if the value is a member of the set π0gets returned if the element is not a member of the set, or ifkeydoes not exist at all π
so like, nonexistent key isn't an error here, it just means everybody gets a 0. she's chill about it.
β¨ REPLY β¨
valkey-protocol(7) Array reply: a list representing the membership of the given elements, in the same order as they are requested.
ORDER. MATTERS. π₯ if you asked about "one" then "notamember", you get the answer for "one" first. don't @ me.
β¨ COMPLEXITY β¨
O(N) where N is the number of elements being checked for membership β
β¨ ACL CATEGORIES β¨
@fast @read @set
she's fast, she's read-only, she's a set girlie. iconic behavior honestly π
β¨ HISTORY β¨
- Available since:
6.2.0π
β¨ EXAMPLES β¨
watch her work, bestie:
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 how the second SADD returned 0? that's because "one" was already in there. she said we been knew π and then SMISMEMBER said 1 for "one" and 0 for "notamember" β in that exact order. ate. π
β¨ 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)
the whole set-friend group π«Ά go say hi.
okay that's the page!! this was version 9.0.0, dated 2025-10-21, and yes it is literally titled SMISMEMBER(3valkey) in the official valkey command manual π thanks for reading, ily, go check your set membership, mwah πβ¨
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms