我正在尝试使用MongoDB过滤数据
let contactsAfterFilter = await Contact.aggregate([
{
$project: {
createdAt: 1,
gender: 1,
customer_phone: 1,
customer_name: 1,
customer_email: 1,
birthday_date: 1,
anniversary_date: 1,
source_type: 1,
tags: 1,
bday: {"$month": '$birthday_date'},
aday: {"$month": '$anniversary_date'}
}
},
{
$match: {"$and": {$in: ["test1", "test2"]}}
},
{
$project: {
createdAt: 1,
gender: 1,
customer_phone: 1,
customer_name: 1,
customer_email: 1,
birthday_date: 1,
anniversary_date: 1,
source_type: 1,
tags: 1
}
},
]);
但它返回一个空数组
{{1}}