I have documents with the following structure:
{field: ["id1", "id3"]},
{field: ["id2", "id1"]}
To query the documents I use
aggregate({$match: {'field' : { $in: ['id1'] }}})
I get the documents with this query but I would like only
{field: ["id2"]},
{field: ["id3"]}
I.e., I want to remove "id1" from the array in the aggregation step only, and not from the actual document (via an update with $pull or something similar).