await redis.sadd("key", "a", "ab","b", "c");const [newCursor, fields] = await redis.sscan("key", 0, { match: "a*"});console.log(newCursor); // likely `0` since this is a very small setconsole.log(fields); // ["a", "ab"]
Set
SSCAN
Scan a set
Copy
Ask AI
await redis.sadd("key", "a", "ab","b", "c");const [newCursor, fields] = await redis.sscan("key", 0, { match: "a*"});console.log(newCursor); // likely `0` since this is a very small setconsole.log(fields); // ["a", "ab"]
The new cursor and the members.
If the new cursor is 0 the iteration is complete.
Copy
Ask AI
await redis.sadd("key", "a", "ab","b", "c");const [newCursor, fields] = await redis.sscan("key", 0, { match: "a*"});console.log(newCursor); // likely `0` since this is a very small setconsole.log(fields); // ["a", "ab"]
Assistant
Responses are generated using AI and may contain mistakes.