Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumMongoDB$lookup joinsSingle-choice MCQ

When a $lookup is followed by a $match that filters on a field produced by the joined array, which optimization concern is most relevant for performance?

db.orders.aggregate([ { $lookup: { from: "items", localField: "_id", foreignField: "orderId", as: "items" } }, { $match: { "items.sku": "ABC" } } ])