Need a JSON path expression for below JSON. I wanted to extract "Id" for each specific "name"
For Example: I need to extract "Id" : "3" for "name" : "XYZ" .
I tried a JSON path expression as $..Id which given output as:
[
"1",
"2",
"3"
]
But I needed an Id specific to "name": "XYZ"`
[
{
"primary":{
"name":"ABC"
},
"Id":"1"
},
{
"primary":{
"name":"PQR"
},
"Id":"2"
},
{
"primary":{
"name":"XYZ"
},
"Id":"3"
}
]