how to do sum of one field from every document in mongodb code example
Example: mongodb-query-to-sum-specific-fields
> db.getSumOfFieldsDemo.aggregate([ { $match: { Status: "Active" } }, { $group: { _id: "$Customer_Id", TotalSum: { $sum: "$Price" } } } ]);