Mongodb 常用命令须远 收录于 数据库 2020-03-14 约 38 字 预计阅读 1 分钟 | 编辑目录 常用命令aggregateMongodb常用命令aggregate求和1 2 3 4 5 db.app_log.aggregate([ { $match: { userId: "kim", type: "use" } }, { $group: { _id: {}, total: { $sum: "$useTime" } } }, { $project: {_id: 0, total: 1}} ]) Please enable JavaScript to view the comments powered by Disqus.