mongodb: how can i use $lookup and $match and $elemMatch in one query
I'm trying to do a lookup from collection1 to collection2 using attachments.collection2_keys (an array), and at the same time filter collection1 where collection2.type is typeA, for any key in attachments.collection2_keys. I believe this query should work, but it returns no…