json.arrindex


目录

Search for the first occurrence of a scalar JSON value in the arrays at the path.

Examples

Enhanced path syntax:

127.0.0.1:6379> JSON.SET k1 . '[[], ["a"], ["a", "b"], ["a", "b", "c"]]'
OK
127.0.0.1:6379> JSON.ARRINDEX k1 $[*] '"b"'
1) (integer) -1
2) (integer) -1
3) (integer) 1
4) (integer) 1

Restricted path syntax:

127.0.0.1:6379> JSON.SET k1 . '{"children": ["John", "Jack", "Tom", "Bob", "Mike"]}'
OK
127.0.0.1:6379> JSON.ARRINDEX k1 .children '"Tom"'
(integer) 2

版本号 #2
由 壳壳虫 创建于 2026-10-31 15:15:36 UTC
由 壳壳虫 更新于 2026-10-31 15:15:37 UTC