{
  "schema_version": 2,
  "id": "commands/arcount",
  "title": "ARCOUNT",
  "url": "https://redis.io/docs/latest/commands/arcount/",
  "summary": "Returns the number of non-empty elements in an array.",
  "since": "8.8.0",
  "tags": [
    "docs",
    "develop",
    "oss",
    "rs",
    "rc",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-07-24T11:07:00+02:00",
  "page_type": "content",
  "content_hash": "a9ad9ef062ea1aebafa19977e031984696840d9eb2e85d5c0ff53d4982475a87",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Returns the number of non-empty elements in an array."
    },
    {
      "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>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> ARSET myarray 0 \"a\"\n(integer) 1\nredis> ARSET myarray 5 \"b\"\n(integer) 1\nredis> ARCOUNT myarray\n(integer) 2"
    },
    {
      "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[Integer reply](../../develop/reference/protocol-spec#integers): The number of non-empty elements, or 0 if key does not exist.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): The number of non-empty elements, or 0 if key does not exist."
    }
  ],
  "examples": []
}
