I have problem statement, in which i need all the field names at child level of "config.first.second" where include field is true at least once. Here is my mongo collection objects.
[ {
"_id" : ObjectId("560e97f4a78eb445cd2d75e5"),
"config" : {
"first" : {
"second" : {
"field1" : {
"include":"true"
},
"field3" : {
"include":"true"
},
"field9" : {
"include":"false"
},
"field6" : {
"include":"false"
}
}
}
},
"date_created" : "Fri Oct 02 14:43:00 UTC 2015",
"last_updated" : "Mon Apr 11 15:26:37 UTC 2016",
"id" : ObjectId("560e97f4a78eb445cd2d75e5")
},
{
"_id" : ObjectId("56154465a78e41c04692af20"),
"config" : {
"first" : {
"second" : {
"field1" : {
"include":"true"
},
"field3" : {
"include":"false"
},
"field7" : {
"include":"true"
}
}
}
},
"date_created" : "Wed Oct 07 16:12:21 UTC 2015",
"last_updated" : "Mon Apr 11 15:18:58 UTC 2016",
"id" : ObjectId("56154465a78e41c04692af20")
}
]
Using above mongo collection . Query must return result
["field1","field3","field7"]