I have a document structures like this :
{
"_id": xxxxx,
"Name": "John Doe",
"Grades":[
{
"Physics":89,
},
{
"Math":45
},
{
"Chemistry":57
}
]
}
I would like to project grades as an array of only the subjects that have over 60.
I tried this but this didn't work:
$arrayElemAt: [{ $objectToArray: { $gte: ['$hhEthGrp',60] } }, 0]