> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-fix-issues-on-docs.mintlify.site/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">
  The path of the array.
</ParamField>

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

## Response

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

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

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