Dentro $cond si possono combinare più confronti con $and.
collection.aggregate({
$group: {
_id: '$someField',
count: {
$sum: {
$cond: [
{
$and: [
{ $eq: ["$otherField", false] },
{ $eq: ["$anotherField", "value"] }
]
},
1,
0
]
}
}
}
});
Il conteggio aumenta solo quando entrambe le condizioni sono vere.