db.events.aggregate([
{
$match : filters
},
{
$group : {
_id : dimensions,
'playSuccessCount' : {
$sum : {
$cond : {if : true, then : 1, else : 0}
}
},
'pageLoadCount' : {$sum: 1}
}
}
]);
db.events.aggregate([
{
$match : filters
},
{
$group : {
_id : dimensions,
'playSuccessCount' : {
$sum : {
$cond : {if : {$eq : ['$vd.T' : 'qos'] }, then : 1, else : 0}
}
},
'pageLoadCount' : {$sum: 1}
}
}
]);
All I am trying todo is to conditionally sum up the plageSuccessCount, but I seem to be getting a syntax error. Is $eq not supported in this context?
Thanks.
-AP_