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

# ARRING

> Append values to a fixed-size ring buffer.

Writes wrap to index zero when the ring is full and overwrite the oldest values. Calling this command with a different size reshapes the ring.

## Arguments

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

<ParamField body="size" type="number" required>
  The number of slots in the ring. Must be greater than zero.
</ParamField>

<ParamField body="values" type="...TData[]" required>
  One or more values to write.
</ParamField>

## Response

<ResponseField type="string" required>
  The index where the last value was written, as a string in TypeScript or an integer in Python.
</ResponseField>

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

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