aggregate([{ "$match": { "timestamp": { "$gte": ISODate("2018-12-18T12:23:48Z"), "$lte": ISODate("2018-12-19T12:23:48Z") }, "equipment_id": NumberLong(168) } }, { "$group": { "_id": "$timestamp", "__agg0" : { "$sum" : "$my_decimal_value" } } }, { "$project": { "timestamp": "$_id", "sqrt_calc": { "$sqrt" : ["$__agg0"] } "_id": 0 } }, { "$sort": { "timestamp": 1 } } ])