Hi i have an collection like this, i am trying to filter the collection,can anybdy help me on this
[{
"parent_id": "DISTRIBUTOR1",
"id": "DISTRIBUTOR3",
"permission": "Yes",
"country_name": "India"
},
{
"parent_id": "DISTRIBUTOR2",
"id": "DISTRIBUTOR3",
"permission": "NO",
"country_name": "India"
},
{
"parent_id": "DISTRIBUTOR2",
"id": "DISTRIBUTOR3",
"permission": "YES",
"city_name": "Hubli",
"state_name": "Karnataka",
"country_name": "India"
},
{
"parent_id": "DISTRIBUTOR2",
"id": "DISTRIBUTOR3",
"permission": "YES",
"city_name": "Bangalore",
"state_name": "Karnataka",
"country_name": "India"
}]
I need an filtered collection where cityname should present and permission:"yes", the output i need is.
Output:
[
{
"parent_id": "DISTRIBUTOR2",
"id": "DISTRIBUTOR3",
"permission": "YES",
"city_name": "Hubli",
"state_name": "Karnataka",
"country_name": "India"
},
{
"parent_id": "DISTRIBUTOR2",
"id": "DISTRIBUTOR3",
"permission": "YES",
"city_name": "Bangalore",
"state_name": "Karnataka",
"country_name": "India"
}]