> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-dx-3009-array-sdk-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ARLEN

> Get the highest occupied array index plus one.

Use [ARCOUNT](./arcount) to count stored values.

## Arguments

<ParamField body="key" type="string" required>
  The array key.
</ParamField>

## Response

<ResponseField type="string" required>
  The highest occupied index plus one. A missing key returns `"0"` in TypeScript or `0` in Python. TypeScript returns a string even for small lengths.
</ResponseField>

<RequestExample>
  ```ts Example theme={"system"}
  await redis.arset("readings", 1000, "sample");
  console.log(await redis.arlen("readings")); // "1001"
  console.log(await redis.arcount("readings")); // 1
  ```
</RequestExample>

See the [server command reference](/redis/commands/array/arlen) for protocol details.
