I am creating a MongoDB aggregation pipeline and I am stuck at this point:
$group: { _id: {checkType: "$_id.checkType", resultCode: "$_id.resultCode"}, count: { $sum: "$count" }, ctv: { $sum: "$ctv" }, perc:{$multiply:[{$divide:["$ctv","$count"]},100]}, weight: { $divide: [ "$ctv", "$count"] }, details: { $push: "$$ROOT" } }
It gives the error "Drive $ multiply is a unary operator." Similarly, if I delete a line with $ multiply, I get: "Battery $ divide is a unary operator" on the next line. I can not find a description of this error on the network. What is wrong with my syntax?
source share