I need to filter a multi-level nested array in MongoDB. The schema is as follows,
{
"_id": "1234",
"array1": [
{
"id": "a11",
"array2": [
{
"id": "a21",
"array3": [
{
"id": "a31",
"status": "done"
},
{
"id": "a32",
"status": "pending"
}
]
}
]
}
]
}
The required output must filter array3 with condition status=done. Which is the best possible method to achieve the same?