Arguments
string
required
The key of the set to store the resulting set in.
...string[]
required
The keys of the sets to perform the difference operation on.
Response
The members of the resulting set.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
await redis.sadd("set1", "a", "b", "c");
await redis.sadd("set2", "c", "d", "e");
await redis.sdiff("dest", "set1", "set2");
console.log(diff); // ["a", "b"]
Write the difference between sets to a new set
await redis.sadd("set1", "a", "b", "c");
await redis.sadd("set2", "c", "d", "e");
await redis.sdiff("dest", "set1", "set2");
console.log(diff); // ["a", "b"]
Was this page helpful?