SISMEMBER(3valkey)

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

πŸ’– SISMEMBER πŸ’–

ok so this is a page from the Valkey Command Manual, bestie, and we're talking about SISMEMBER β€” the girl who does one (1) job and does it flawlessly. no cap. let's get into it πŸŽ€


✨ NAME ✨

sismember β€” tells you whether a member belongs to a set. that's it. that's the whole gig. she's not complicated, she's just reliable πŸ’…


🌸 SYNOPSIS 🌸

SISMEMBER key member

two args. in, out. iconic behavior honestly πŸ¦‹


🧚 DESCRIPTION 🧚

Returns if member is a member of the set stored at key.

literally that's it. you hand her a key and a member, she tells you if that member is in the set. no drama, no side quests, no "let me think about it". 🫢


⭐ REPLY ⭐

One of the following, so pay attention bestie:

  • valkey-protocol(7) Integer reply: 0 if the element is not a member of the set, or when the key does not exist.
  • valkey-protocol(7) Integer reply: 1 if the element is a member of the set.

so basically 1 = she's in, 0 = she's not (and also 0 if the key straight-up doesn't exist β€” yes, missing key and "not in the set" look the same from here, that's just how she rolls πŸ™ˆ).


πŸ”₯ COMPLEXITY πŸ”₯

O(1)

constant time, babes. one lookup, no matter how thicc the set is. main character efficiency πŸ’€βœ¨


πŸ’œ ACL CATEGORIES πŸ’œ

@fast @read @set

three little badges and she earned every one of them πŸ‘‘


πŸŽ€ HISTORY πŸŽ€

  • Available since: 1.0.0

she's been here since 1.0.0. an OG. a founding mother. respect her πŸ«‘πŸ’–


🌈 EXAMPLES 🌈

here's the whole vibe in action, copy it, paste it, slay it:

127.0.0.1:6379> SADD myset "one"
(integer) 1
127.0.0.1:6379> SISMEMBER myset "one"
(integer) 1
127.0.0.1:6379> SISMEMBER myset "two"
(integer) 0

see how "one" got a 1 and "two" got a 0? that's the entire plot. ate and left no crumbs πŸ“


πŸ¦‹ SEE ALSO πŸ¦‹

her whole friend group, go say hi:


ok that's the whole page, bestie πŸ’– this one came from Valkey 9.0.0, dated 2025-10-21, and it was a SISMEMBER(3valkey) situation from start to finish. go check your sets, mwah πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from