Qualcosa come:
db.myTable.aggregate([
{ $match: { mydate: { $lte: new Date('12/01/1998') } } },
{ $group: {
_id: "$keyid",
totalqty: { $sum: "$qty" }
}}
])
Qualcosa come:
db.myTable.aggregate([
{ $match: { mydate: { $lte: new Date('12/01/1998') } } },
{ $group: {
_id: "$keyid",
totalqty: { $sum: "$qty" }
}}
])