I'm trying to filter the list of an array of array arrays, this is an example of structure.
{
"array1": [
{
"array2": [
{
"array3": [
{
"sampleId": 1
},
{
"sampleId": 2
},
{
"sampleId": 5
}
]
},
{
"array3": [
{
"sampleId": 7
},
{
"sampleId": 8
}
]
}
]
},
{
"array2": [
{
"array3": [
{
"sampleId": 1
}
]
}
]
}
]
}
Let's say that i want to filter out all the subdocuments with sampleId > 2
this is an example of the expected result.
{
"array1": [
{
"array2": [
{
"array3": [
{
"sampleId": 1
},
{
"sampleId": 2
}
]
},
{
"array3": []
}
]
},
{
"array2": [
{
"array3": [
{
"sampleId": 1
}
]
}
]
}
]
}
I tried using aggregation/map/filter technique as explained in this post and others but the results are always giving array3 empty.