# 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
element = redis.json.arrpop("key", "$.path.to.array")
```

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