Mongodb Filter Nested Array, Explore advanced MongoDB techniques for querying and projecting documents with deeply nested arrays, including $elemMatch, $filter, and $unwind aggregation stages. What you are missing is a $map for the top level list. To set filtering conditions for nested arrays in MongoDB, use the $filter operator combined with $anyElementTrue and $map in an aggregation pipeline. Learn more about Aggregate Filter Nested Array in MongoDB. There is still a restriction which might or might not be problematic for your use-case: The $-operator only returns the first entry of each array per document. MongoDB-Query deeply nested array containing a specific value. Query deeply nested array elements using regex or matching criteria. Our MongoDB Support team is here to help you with your questions and concerns. By mastering advanced techniques and optimizing pipeline However, different names for list, id and name at different level would make the solution easier to understand. MongoDB Manual: How to query or select on embedded or nested documents, subdocuments and fields. btrms0 zkr vmnben8 mx2xhd 56ber hw marv byxuo pudot a85h