Arguments
string
required
The key of the json entry.
string
default:"$"
The path of the array.
integer
required
The start index of the range.
integer
required
The stop index of the range.
Response
The length of the array after the trimming.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
const length = await redis.json.arrtrim("key", "$.path.to.array", 2, 10);
Trim an array so that it contains only the specified inclusive range of elements.
const length = await redis.json.arrtrim("key", "$.path.to.array", 2, 10);
Was this page helpful?