Json

JSON.ARRINSERT

Insert the json values into the array at path before the index (shifts to the right).

Arguments

keybodystringrequired

The key of the json entry.

pathbodystringrequired

The path of the array. $ is the root.

indexbodyintegerrequired

The index where to insert the values.

valuesbody...TValue[]required

One or more values to append to the array.

Response

integer[]required

The length of the array after the insertion.

Example
const length = await redis.json.arrinsert("key", "$.path.to.array", 2, "a", "b");
Loading search…