How to group query with multiple $cond?

Viewed 43309

I want to query like below, but this contains only one $cond.

How to query with two $cond?

collection.aggregate(
    { 
        $match : { 
            '_id' : {$in:ids}
        } 
    },
    {
        $group: {
            _id: '$someField',
            ...
            count: {$sum: { $cond: [ { $eq: [ "$otherField", false] } , 1, 0 ] }}
        }
    },
    function(err, result){
        ...
    }
);
1 Answers
Related