I have a collection:
{ "_id" : ObjectId("5c7c804f14b4c026ba7fcaba"), "values" : [ { "active" : true, "id" : 30, }, { "active" : true, "id" : 33, }, { "active" : true, "id" : 34, }, { "active" : true, "id" : 35, }, { "active" : true, "id" : 36, } ]
}
You need to get the result:
{ "_id" : ObjectId("5c7c804f14b4c026ba7fcaba"), "values" : [ { "active" : true, "id" : 30, }, { "active" : true, "id" : 34, }, { "active" : true, "id" : 35, }, { "active" : true, "id" : 36, } ]
}
that is, do not display value.id = 33 as a result. Can this be done not through the aggregation ..aggregate (), but through find ()? Maybe some kind of javascript code with the condition can be screwed, which is not value.id = 33?
$filter
- styvane 8:25 pm