const index = await redis.json.arrindex("key", "$.path.to.array", "a");

Arguments

key
string
required

The key of the json entry.

path
string
default:
"$"

The path of the array.

value
TValue
required

The value to search for.

start
integer
default:
0

The start index.

stop
integer
default:
0

The stop index.

Response

The index of the first occurrence of the value in the array, or -1 if not found.

const index = await redis.json.arrindex("key", "$.path.to.array", "a");