> ## 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="string" required>
  The array key.
</ParamField>

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

<ParamField body="options" type="Object">
  <ParamField body="rev" type="boolean">
    Return newest values first. Defaults to false.
  </ParamField>
</ParamField>

## Response

<ResponseField type="(TData | null)[]" 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>

Values use the SDK's automatic deserialization. Use `TData` to describe stored JSON values; it defaults to `string`.

<RequestExample>
  ```ts Example theme={"system"}
  await redis.arring("recent", 3, "a", "b", "c", "d");
  console.log(await redis.arlastitems("recent", 3)); // ["b", "c", "d"]
  console.log(await redis.arlastitems("recent", 3, { rev: true })); // ["d", "c", "b"]
  ```
</RequestExample>

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