{
$group: {
_id: { ["$dayOfYear"]: "$TagDateCreated" },
disqualified: {
$addToSet: {
$cond: {
if: { $in: [ "$TagId", [109,220,115,113,238] ]},
then: "$ContactId",
else: null
}
}
}
}
}
这给了我一个唯一的contactId设置为不合格,但我需要删除空值。我试过省略$cond中的else语句和$project中的各种$filters,它们要么不删除任何内容,要么删除所有内容,要么出错。