# Source: https://upstash.com/docs/redis/sdks/ts/commands/json/arrpop.md

# Source: https://upstash.com/docs/redis/sdks/py/commands/json/arrpop.md

> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# JSON.ARRPOP

> Remove and return an element from the index in the array. By default the last element from an array is popped.

## Arguments

<ParamField body="key" type="str" required>
  The key of the json entry.
</ParamField>

<ParamField body="path" type="str" required>
  The path of the array. `$` is the root.
</ParamField>

<ParamField body="index" type="int" default={-1}>
  The index of the element to pop.
</ParamField>

## Response

<ResponseField type="List[TValue | null]" required>
  The popped element or null if the array is empty.
</ResponseField>

<RequestExample>
  ```py Example theme={"system"}
  element = redis.json.arrpop("key", "$.path.to.array")
  ```

  ```py First theme={"system"}
  firstElement = redis.json.arrpop("key", "$.path.to.array", 0)
  ```
</RequestExample>