Jsonpath:如何通过子节点的值找到节点?

时间:2014-08-19 19:12:15

标签: jsonpath

"things":[
  ...
  {
    "id":10,
    "stuff":"words"
  }
]

假设我不知道该对象的索引是什么,但我知道id = 10.有没有办法使用JSONpath找到它?

1 个答案:

答案 0 :(得分:4)

试试这个:

@ = currentObject
?() = filter

things.*[?(@.id=10)].stuff

来源:http://goessner.net/articles/JsonPath/