> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SSCAN

> Scan a set

## Arguments

<ParamField body="key" type="string" required>
  The key of the set.
</ParamField>

<ParamField body="cursor" type="number">
  The cursor, use `0` in the beginning and then use the returned cursor for subsequent calls.
</ParamField>

<ParamField body="options" type="Object">
  <ParamField body="match" type="string">
    Glob-style pattern to filter by members.
  </ParamField>

  <ParamField body="count" type="number">
    Number of members to return per call.
  </ParamField>
</ParamField>

## Response

<ResponseField type="[number, TMember[]]" required>
  The new cursor and the members.
  If the new cursor is `0` the iteration is complete.
</ResponseField>

<RequestExample>
  ```ts Example theme={"system"}
  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 set
  console.log(fields); // ["a", "ab"]
  ```
</RequestExample>
