await redis.sadd("set1", "a", "b", "c");
await redis.sadd("set2", "c", "d", "e");
const union = await redis.sunion("set1", "set2");
console.log(union); // ["a", "b", "c", "d", "e"]
Return the union between sets
await redis.sadd("set1", "a", "b", "c");
await redis.sadd("set2", "c", "d", "e");
const union = await redis.sunion("set1", "set2");
console.log(union); // ["a", "b", "c", "d", "e"]
await redis.sadd("set1", "a", "b", "c");
await redis.sadd("set2", "c", "d", "e");
const union = await redis.sunion("set1", "set2");
console.log(union); // ["a", "b", "c", "d", "e"]
Was this page helpful?