如何为xads这个查询添加条件? (Exp:lads.status = 1)
db.xads.aggregate([
{
$lookup: {
from: 'xaditems',
localField: '_id',
foreignField: 'masterId',
as: 'xadItems'
},
}
]);
答案 0 :(得分:0)
db.xads.aggregate([
{
$match:{"status":1} //add you filters in match
},
{
$lookup: {
from: 'xaditems',
localField: '_id',
foreignField: 'masterId',
as: 'xadItems'
},
}
]);
答案 1 :(得分:0)
行!谢谢DHIRAJ KATEKAR
db.xads.aggregate([
{
$match:{"status":1}
},
{
$lookup: {
from: 'xaditems',
localField: '_id',
foreignField: 'masterId',
as: 'xadItems'
},
}
]);