> ## 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.

# ARLASTITEMS

> Read the most recently appended array values.

Reads walk backward from the append cursor and wrap at index zero. Positional writes do not move that cursor.

## Arguments

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

<ParamField body="count" type="int" required>
  The maximum number of values to return. Must be nonnegative and is capped at the number of stored values.
</ParamField>

<ParamField body="rev" type="bool">
  Return newest values first. Defaults to False.
</ParamField>

## Response

<ResponseField type="List[Optional[str]]" required>
  Values in oldest-first order, or newest-first when `rev` is enabled. Empty slots are returned as `null` (TypeScript) / `None` (Python). A missing key returns an empty list.
</ResponseField>

<RequestExample>
  ```py Example theme={"system"}
  redis.arring("recent", 3, "a", "b", "c", "d")
  print(redis.arlastitems("recent", 3))  # ["b", "c", "d"]
  print(redis.arlastitems("recent", 3, rev=True))  # ["d", "c", "b"]
  ```
</RequestExample>

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