{
  "id": "arring",
  "title": "ARRING",
  "url": "https://redis.io/docs/latest/commands/arring/",
  "summary": "Inserts values into a ring buffer of specified size, wrapping and truncating as needed.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-05-25T10:30:01-07:00",
  "page_type": "content",
  "content_hash": "30aa8786330efc21c3ce2b177aaeb3120bedbd8555e34703e74b62d24e87f702",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Inserts values into a ring buffer of specified size, wrapping and truncating as needed."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key that holds the array.\n\n</details>\n\n<details open><summary><code>size</code></summary>\n\nThe size of the ring buffer window. Each value is inserted at `insert_idx % size`, wrapping back to index `0` when the end of the window is reached. When the buffer is full, newer values overwrite older ones. If `size` is smaller than the current window, the array is truncated to fit.\n\n</details>\n\n<details open><summary><code>value</code></summary>\n\nOne or more string values to insert into the ring buffer. Each value is placed at the next position in the ring and the cursor advances accordingly.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "ARRING readings 3 \"v0\"\nARRING readings 3 \"v1\"\nARRING readings 3 \"v2\"\nARRING readings 3 \"v3\"\nARGET readings 0\nARCOUNT readings\nARLASTITEMS readings 3"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): The last index where a value was inserted.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): The last index where a value was inserted."
    }
  ],
  "examples": []
}
