I have a below collection
[
{
"Array1": [
{
"Array2": [
{
"name": "6666",
"Array3": [
{ "_id": 128938120, "nest": "samsung" },
{ "_id": 12803918239, "nest": "nokia" }
]
},
{
"name": "5555",
"Array3": [
{ "_id": 48102938109, "nest": "iphone" },
{ "_id": 501293890, "nest": "micromax" }
]
}
],
"name": "old apartment"
},
{
"Array2": [
{
"_id": 410923810,
"name": "3333",
"Array3": [
{ "_id": 48102938190, "nest": "airtel" },
{ "_id": 48102938190, "nest": "jio" }
]
},
{
"_id": 41092381029,
"name": "2222",
"Array3": [
{ "_id": 10293182309, "nest": "master" },
{ "_id": 38190238, "nest": "cub" }
]
}
],
"name": "new apartment"
}
]
}
]
I want to fo $filter
to 3 nested level... I want only nokia
element from 3rd array and 6666
element from second and old apartment
from the first
I want this output
[
{
"Array1": [
{
"Array2": [
{
"name": "6666",
"Array3": [
{
"_id": 12803918239,
"nest": "nokia"
}
]
}
],
"name": "old apartment"
}
]
}
]
And also I want to do using $filter
and $map
only... Don't want to use $unwind
here