Hello, I need help, I want to get the TOTAL number of one parameter in the document. How can this be done quickly, I tried to do it through “reduce”, tried through $group $sum, it does not work, or the answer is “undefined”, or [ object Promise ], I have been suffering for 5 hours, I can not do such a simple thing.
Briefly what I want:
User = is collection
I want to sum the “money” field in all documents in the collection.