Json
JSON.ARRINDEX
Search for the first occurrence of a JSON value in an array.
Arguments
keybodystringrequired
The key of the json entry.
pathbodystringrequired
The path of the array. $ is the root.
valuebodyTValuerequired
The value to search for.
startbodyintegerdefault: 0
The start index.
stopbodyintegerdefault: 0
The stop index.
Response
integer[]required
The index of the first occurrence of the value in the array, or -1 if not found.
Example
const index = await redis.json.arrindex("key", "$.path.to.array", "a");