SINTER(3valkey)

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

SINTER(3valkey) πŸ’…

okay bestie, welcome to the Valkey Command Manual β€” this is sinter, and she's here to find the overlap. the vibe check of sets, if you will. ✨


✨ NAME ✨

<sinter> sinter </sinter> β€” returns the intersect of multiple sets. πŸŽ€


✨ SYNOPSIS ✨

SINTER key [key...]

✨ DESCRIPTION ✨

so basically: it returns the members of the set that come out of the intersection of all the given sets. like, the stuff they ALL agree on. the mutuals. 🫢

for example, check this out:

key1 = {a,b,c,d}
key2 = {c}
key3 = {a,c,e}
SINTER key1 key2 key3 = {c}

see how c is the only one in every single set? iconic. the rest got left on read. πŸ’€

keys that do not exist are considered to be empty sets. and bestie, listen β€” with one of the keys being an empty set, the resulting set is also empty, because set intersection with an empty set always results in an empty set. that's just the rules, no cap. 🌸


✨ REPLY ✨

RESP2

valkey-protocol(7) Array reply: a list with the members of the resulting set.

RESP3

valkey-protocol(7) Set reply: the resulting set.


✨ COMPLEXITY ✨

O(N*M) worst case, where N is the cardinality of the smallest set and M is the number of sets. she's doing math, respect her. 🧚


✨ ACL CATEGORIES ✨

@read @set @slow


✨ HISTORY ✨

  • Available since: 1.0.0 β€” an OG, fr fr πŸ‘‘

✨ EXAMPLES ✨



127.0.0.1:6379> SADD key1 "a"
(integer) 1
127.0.0.1:6379> SADD key1 "b"
(integer) 1
127.0.0.1:6379> SADD key1 "c"
(integer) 1
127.0.0.1:6379> SADD key2 "c"
(integer) 1
127.0.0.1:6379> SADD key2 "d"
(integer) 1
127.0.0.1:6379> SADD key2 "e"
(integer) 1
127.0.0.1:6379> SINTER key1 key2
1) "c"

look at her go. "c" is the moment. the crossover event. πŸ”₯


✨ SEE ALSO ✨


okay that's the whole page, bestie. go intersect some sets, you're gonna ate. πŸ’–

version 9.0.0, dated 2025-10-21 β€” mwah, xoxo, the Valkey girlies πŸŽ€βœ¨

πŸ“¦ where this page comes from