I have a json file which looks like:
{
"ancestors": [
{
"subcategory": [
{
"key": "city",
"name": "City"
}
],
"name": "Da Lat"
},
{
"subcategory": [
{
"key": "province",
"name": "Province"
}
],
"name": "Lam Dong Province"
},
{
"subcategory": [
{
"key": "country",
"name": "Country"
}
],
"name": "Vietnam"
}
],
}
The problem is that I need to access the name of that subcategory whose key is province.
Here i want to access "Lam Dong Province"
I cant figure out how to go up one level and check the conditions.