I have created the pipeline which will find the sum of the field I want but I just cant find a way to execute it in the node js project and get the sum as the result.
Try this:
{ $sum: [ <expression1>, <expression2>] }