聚合操作多个match条件需要怎么写?
发布于 4 年前 作者 xiulanding 465 次浏览 来自 问答
db.collection('order_list')
.aggregate()
.match({
orderDate:_.gte('2020'),
})
.match({
orderDate: _.lte('2021'),
})
.match({
compId:'79550af2603f576f081972820840304d'
})
.lookup({
from: 'customer',
localField: 'customerInfo.customerId',
foreignField: '_id',
as: 'customerDetail'
})
.end()

例如上面代码中多个条件匹配,match需要怎么写 ?

回到顶部