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 union of multiple sets
await redis.sunion(key, ...keys);
await redis.sadd("set1", "a", "b", "c"); await redis.sadd("set2", "c", "d", "e"); const result = await redis.sunion("set1", "set2"); console.log(result); // ["a", "b", "c", "d", "e"]
await redis.sadd("skills:alice", "javascript", "python"); await redis.sadd("skills:bob", "python", "go"); await redis.sadd("skills:charlie", "java", "javascript"); const allSkills = await redis.sunion( "skills:alice", "skills:bob", "skills:charlie" ); console.log(allSkills); // ["javascript", "python", "go", "java"]
await redis.sadd("tags:frontend", "react", "vue", "angular"); await redis.sadd("tags:backend", "node", "django", "rails"); const allTags = await redis.sunion("tags:frontend", "tags:backend"); console.log(allTags); // ["react", "vue", "angular", "node", "django", "rails"]
await redis.sadd("set1", "a", "b", "c"); const result = await redis.sunion("set1", "nonexistent"); console.log(result); // ["a", "b", "c"]