SISMEMBER(3valkey)
π 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:
0if the element is not a member of the set, or when the key does not exist. - valkey-protocol(7) Integer reply:
1if 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 π₯
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:
sadd(3valkey)scard(3valkey)sdiff(3valkey)sdiffstore(3valkey)sinter(3valkey)sintercard(3valkey)sinterstore(3valkey)smembers(3valkey)smismember(3valkey)smove(3valkey)spop(3valkey)srandmember(3valkey)srem(3valkey)sscan(3valkey)sunion(3valkey)sunionstore(3valkey)
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
- 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