I\'m trying to sum some values in an array of documents, with no luck.
This is the Document
db.Cuentas.find().pretty()
{ \"Agno\": \"2013
You can do also by this way. don't need to group just project your fields.
db.Cuentas.aggregate([ { $match: { "Usuario": "MarioCares" } }, { $project: { 'MontoSum': { $sum: "$Egresos.Monto" } } } ])