MongoDB lookup array of objects by field (join conditions and uncorrelated sub-queries)
问题 I don't understand what I'm missing with the aggregation lookup using join conditions and uncorrelated sub-queries. processes collection: { _id: 'p1', steps: [ { _id: 'ps1', step: 's1', time: 10 }, { _id: 'ps2', step: 's2', time: 15 } ] } steps collection (for the document with _id: s1 ): { _id: 's1', name: 'step 1' } Working aggregation (standard one, without join conditions and uncorrelated sub-queries): processes.aggregate([ { // match stage or whatever prior stage }, { $lookup: { from: