Adding values of multiple documents. Javascript and MongoDB

Hi. I am running a query on my mongodb using the driver and writing the code in javascript. I am quite new to this.
So my question is , after i run the query i get the results for each individual document with the field i am querrying. How can i combine all of those results to give me one number. I am posting my results below.

As you can see above i get three results , one for each document. How can I add those field values together. Dont know if it is a javascript or mongo technique.

Thank you

You should take a look at The $match and $group stages would be a good starting point.

MongoDB university offers a an aggregation framework specific course (M121). You may find more information at

But you can do it in JavaScript also using any JavaScript arithmetic operators.

Noi understand how to run the aggregation inmongo and a query in JS. My question is how do i add all the individual values from a certain field in al the different documents together.