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

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

<ParamField body="values" type="*values: ValueT" required>
  One or more values to write. Values may be strings, integers, floats, or booleans.
</ParamField>

## Response

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

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

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