goessner json path non-recursive expression

时间:2015-07-22 23:23:35

标签: jsonpath

What should be the Goesnner json path expression if I want to read only the parent id-Property and not the read all the child id-property recursively

Here's the example json that I am trying to parse :

[{
    "Id": 1,
    "Name": "Abhishek",
    "Partners": [
        {
            "Id": 4,
            "Name": "COMPANION"
        }
    ]
},
{
    "Id": 8,
    "name": "Dice Operations",
    "Partners": []
 }]

I would like to get the output of 1 and 8. But I keep getting the id 4 included. Here are the expressions that I have tried at curiousconcept中查找特定链接:

  1. $。[0] .ID
  2. $。[*](出处同上)
  3. $ ..编号

1 个答案:

答案 0 :(得分:0)

我明白了。它应该是:$.*.Id