SMISMEMBER(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– 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:

  • 1 gets returned if the value is a member of the set πŸ’–
  • 0 gets returned if the element is not a member of the set, or if key does 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 ✨

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