MongoDB_2:mongodb高级聚合查询
mongodb聚合查询:查询广告组的总收入
db.realtime_report.aggregate([ {'$match': { 'date' : { '$gte' : '2021-07-19', '$lte' : '2021-07-21' }, "platform" : "广点通", "app_name" : "成语高手", "advertiser_id" : "20880248",}}, {'$group': {'_id': '$group_id', 'cost':{'$sum': '$consume'}}}, {'$sort': {'cost': -1}} ])