I have data as below
[
{
"_id": 1,
"members": [
"a1",
"a2"
],
"member_profiles": [
{
"_id": "a1",
"is_removed": true
}
]
},
{
"_id": 2,
"members": [
"a1",
"a3"
],
"member_profiles": [
{
"_id": "a3",
"is_removed": true
}
]
}
]
I want to select only those members from a document which are not having is_removed flag 'true'
So above query should give me ["a2"] from the first document and ["a1"] from the second document.
In the end, i want to get all these member ids in one collection which we do via grouping but I am stuck on how to do document level filtering
Thanks in advance