Query to sum all the balance
1db.getCollection("transactions").aggregate([{ "$match": { "tlData.amount": { "$lte": 0 } } }, {$group: {_id: null, "total": {$sum: "$tlData.amount"}}}]);
Created on 9/21/2020