I had this type of JSON structure and I want to fetch the upper element in the hierarchy on applying condition on lower element in hierarchy
{
"name": "ninja",
"contry": "India",
"Account": [
{
"id": "123",
"orgId": 223,
"investment": [
{
"invetmentId": "111",
"name": "India tech",
"performance": [
{
"id": "123",
"performanceSet": [
{
"amount": "210",
"currency": "YEN"
},
{
"amount": "231",
"currency": "USD"
},
{
"amount": "233",
"currency": "USD"
},
{
"amount": "250",
"currency": "IND"
}
],
"loyal": "250"
}
]
},
{
"invetmentId": "111",
"name": "USA tech",
"performance": [
{
"id": "245",
"performanceSet": [
{
"amount": "956",
"currency": "ASD"
},
{
"amount": "231",
"currency": "USD"
},
{
"amount": "233",
"currency": "USD"
},
{
"amount": "250",
"currency": "IND"
}
],
"loyal": "250"
}
]
}
]
}
]
}
So what I need is I need the investment name for which performance.id = 123 i.e it should return "India tech".So I want to know if that can be possible or not if yes how can I get that?