Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get the intersection of multiple sets
await redis.sinter(key, ...keys);
await redis.sadd("set1", "a", "b", "c", "d"); await redis.sadd("set2", "c", "d", "e", "f"); const result = await redis.sinter("set1", "set2"); console.log(result); // ["c", "d"]
await redis.sadd("tags:post1", "javascript", "typescript", "react"); await redis.sadd("tags:post2", "typescript", "react", "node"); await redis.sadd("tags:post3", "react", "vue", "typescript"); const commonTags = await redis.sinter("tags:post1", "tags:post2", "tags:post3"); console.log(commonTags); // ["typescript", "react"]
await redis.sadd("friends:alice", "bob", "charlie", "david"); await redis.sadd("friends:bob", "alice", "charlie", "eve"); const mutualFriends = await redis.sinter("friends:alice", "friends:bob"); console.log(mutualFriends); // ["charlie"]
await redis.sadd("set1", "a", "b", "c"); await redis.sadd("set2", "d", "e", "f"); const result = await redis.sinter("set1", "set2"); console.log(result); // []