Как добавить условие для xads этого запроса? (Exp: lads.status = 1)
db.xads.aggregate([ { $lookup: { from: 'xaditems', localField: '_id', foreignField: 'masterId', as: 'xadItems' }, } ]);
Works! Спасибо DHIRAJ KATEKAR
db.xads.aggregate([ { $match:{"status":1} }, { $lookup: { from: 'xaditems', localField: '_id', foreignField: 'masterId', as: 'xadItems' }, } ]);
db.xads.aggregate([ { $match:{"status":1} //add you filters in match }, { $lookup: { from: 'xaditems', localField: '_id', foreignField: 'masterId', as: 'xadItems' }, } ]);