{
  "schema_version": 2,
  "id": "commands/json.arrpop",
  "title": "JSON.ARRPOP",
  "url": "https://redis.io/docs/latest/commands/json.arrpop/",
  "summary": "Removes and returns the element at the specified index in the array at path",
  "since": "1.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:47:58+01:00",
  "page_type": "content",
  "content_hash": "d2039788602f4e81a7dbeed9d97b095ec6c5fab7633d1b228b190023a5344c3d",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Remove and return an element from the index in the array\n\n[Examples](#examples)"
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary> \n\nis key to modify.\n</details>\n\n<details open><summary><code>index</code></summary> \n\nis position in the array to start popping from. Default is `-1`, meaning the last element. Out-of-range indexes round to their respective array ends. Popping an empty array returns null.\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>path</code></summary> \n\nis JSONPath to specify. Default is root `$`.\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "<details open>\n<summary><b>Pop a value from an index and insert a new value</b></summary>\n\nCreate two headphone products with maximum sound levels.\n\n\nredis> JSON.SET key $ '[{\"name\":\"Healthy headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[60,70,80]},{\"name\":\"Noisy headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[80,90,100,120]}]'\nOK\n\n\nGet all maximum values for the second product.\n\n\nredis> JSON.GET key $.[1].max_level\n\"[[80,90,100,120]]\"\n\n\nUpdate the `max_level` field of the product: remove an unavailable value and add a newly available value.\n\n\nredis> JSON.ARRPOP key $.[1].max_level 0\n1) \"80\"\n\n\nGet the updated array.\n\n\nredis> JSON.GET key $.[1].max_level\n\"[[90,100,120]]\"\n\n\nNow insert a new lowest value.\n\n\nredis> JSON.ARRINSERT key $.[1].max_level 0 85\n1) (integer) 4\n\n\nGet the updated array.\n\n\nredis> JSON.GET key $.[1].max_level\n\"[[85,90,100,120]]\"\n\n</details>"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Supported</span><br /> | <span title=\"Supported\">&#x2705; Flexible & Annual</span><br /><span title=\"Supported\">&#x2705; Free & Fixed</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of [bulk string replies](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) or [null replies](https://redis.io/docs/latest/develop/reference/protocol-spec#nulls), where each element is the popped JSON value as a string, or `null` if the matching value is not an array.\n\n**RESP3:**\n\n[Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of [bulk string replies](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) or [null replies](https://redis.io/docs/latest/develop/reference/protocol-spec#nulls), where each element is the popped JSON value as a string, or `null` if the matching value is not an array."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`JSON.ARRAPPEND`](https://redis.io/docs/latest/commands/json.arrappend) | [`JSON.ARRINDEX`](https://redis.io/docs/latest/commands/json.arrindex)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "* [RedisJSON](https://redis.io/docs/latest/develop/data-types/json)\n* [Index and search JSON documents](https://redis.io/docs/latest/develop/ai/search-and-query/indexing)"
    }
  ],
  "examples": []
}
