{
  "id": "arscan",
  "title": "ARSCAN",
  "url": "https://redis.io/docs/latest/commands/arscan/",
  "summary": "Iterates existing elements in a range, returning index-value pairs.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-05-25T10:30:01-07:00",
  "page_type": "content",
  "content_hash": "8958f4a65505e29c9791279a2251d7420ed7abda6dd20821d17b342b2f29c449",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Iterates existing elements in a range, returning index-value pairs."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key that holds the array.\n\n</details>\n\n<details open><summary><code>start</code></summary>\n\nThe zero-based integer index at which to begin scanning. If `start` is greater than `end`, elements are returned in reverse index order.\n\n</details>\n\n<details open><summary><code>end</code></summary>\n\nThe zero-based integer index at which to stop scanning (inclusive).\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>LIMIT</code></summary>\n\nThe maximum number of index-value pairs to return. When omitted, all elements in the range are returned. Unlike `ARGETRANGE`, empty slots are not included in the output, so `LIMIT` caps the number of existing elements returned.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "ARSET myarray 0 \"a\"\nARSET myarray 5 \"b\"\nARSET myarray 9 \"c\"\nARSCAN myarray 0 10\nARSCAN myarray 0 10 LIMIT 2"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Array reply](../../develop/reference/protocol-spec#arrays): Flat array of index-value pairs: [idx1, val1, idx2, val2, ...]\n\n**RESP3:**\n\n[Array reply](../../develop/reference/protocol-spec#arrays): Flat array of index-value pairs: [idx1, val1, idx2, val2, ...]"
    }
  ],
  "examples": []
}
