# ARLEN

```json metadata
{
  "title": "ARLEN",
  "description": "Returns the length of an array (max index + 1).",
  "categories": ["docs","develop","stack","oss","rs","rc","oss","kubernetes","clients"],
  "arguments": [{"key_spec_index":0,"name":"key","type":"key"}],
  "syntax_fmt": "ARLEN key",
  "complexity": "O(1)",
  "group": "array",
  "command_flags": ["READONLY","FAST"],
  "acl_categories": ["ARRAY"],
  "since": "8.8.0",
  "arity": 2,
  "key_specs": [{"begin_search":{"index":{"pos":1}},"find_keys":{"range":{"lastkey":0,"limit":0,"step":1}},"flags":["RO","ACCESS"]}],
  "tableOfContents": {"sections":[{"id":"required-arguments","title":"Required arguments"},{"id":"examples","title":"Examples"},{"id":"return-information","title":"Return information"}]}

,
  "codeExamples": []
}
```Returns the length of an array (max index + 1).

## Required arguments

<details open><summary><code>key</code></summary>

The name of the key that holds the array.

</details>

## Examples


ARSET myarray 0 "a"
ARSET myarray 5 "b"
ARLEN myarray
ARCOUNT myarray


## Return information

**RESP2:**

[Integer reply](../../develop/reference/protocol-spec#integers): The length of the array (max index + 1), or 0 if key does not exist.

**RESP3:**

[Integer reply](../../develop/reference/protocol-spec#integers): The length of the array (max index + 1), or 0 if key does not exist.



