{
  "schema_version": 2,
  "id": "commands/arscan",
  "title": "ARSCAN",
  "url": "https://redis.io/docs/latest/commands/arscan/",
  "summary": "Iterates existing elements in a range, returning index-value pairs.",
  "since": "8.8.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-28T15:41:00+02:00",
  "page_type": "content",
  "content_hash": "51b273299f678091198625a59b766e388c4653c1804c930701ff60900ac2802b",
  "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": "redis> ARSET myarray 0 \"a\"\n(integer) 1\nredis> ARSET myarray 5 \"b\"\n(integer) 1\nredis> ARSET myarray 9 \"c\"\n(integer) 1\nredis> ARSCAN myarray 0 10\n1) 1) (integer) 0\n   2) \"a\"\n2) 1) (integer) 5\n   2) \"b\"\n3) 1) (integer) 9\n   2) \"c\"\nredis> ARSCAN myarray 0 10 LIMIT 2\n1) 1) (integer) 0\n   2) \"a\"\n2) 1) (integer) 5\n   2) \"b\""
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Array reply](../../develop/reference/protocol-spec#arrays): Array of index-value pairs, each a two-element array: `[[idx1, val1], [idx2, val2], ...]`\n\n**RESP3:**\n\n[Array reply](../../develop/reference/protocol-spec#arrays): Array of index-value pairs, each a two-element array: `[[idx1, val1], [idx2, val2], ...]`"
    }
  ],
  "examples": []
}
