Json

JSON.ARRPOP

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

Arguments

keybodystringrequired

The key of the json entry.

pathbodystring

The path of the array.

indexbodynumberdefault: -1

The index of the element to pop.

Response

(TValue | null)[]required

The popped element or null if the array is empty.

Example
const element = await redis.json.arrpop("key", "$.path.to.array");
First
const firstElement = await redis.json.arrpop("key", "$.path.to.array", 0);
Loading search…