{
  "id": "arlastitems",
  "title": "ARLASTITEMS",
  "url": "https://redis.io/docs/latest/commands/arlastitems/",
  "summary": "Returns the most recently inserted elements.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-05-25T10:30:01-07:00",
  "page_type": "content",
  "content_hash": "dd1f49b2dbd51a56b39de376cdd205021ab28bb924977fcb42679f8644d5c17e",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Returns the most recently inserted elements."
    },
    {
      "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>count</code></summary>\n\nThe maximum number of most recently inserted elements to return. If the array contains fewer elements than `count`, all elements are returned.\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>REV</code></summary>\n\nWhen present, returns elements in reverse chronological order (most recent first) instead of the default oldest-first order.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "ARINSERT log \"first\"\nARINSERT log \"second\"\nARINSERT log \"third\"\nARLASTITEMS log 2\nARLASTITEMS log 2 REV"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Array reply](../../develop/reference/protocol-spec#arrays)\n\n**RESP3:**\n\n[Array reply](../../develop/reference/protocol-spec#arrays)"
    }
  ],
  "examples": []
}
