db.tablename.aggregate([ {"$group" : {_id:"$fieldname", count:{$sum:1}}} ])
mongodb group by 统计
最新推荐文章于 2022-06-07 11:37:38 发布
db.tablename.aggregate([ {"$group" : {_id:"$fieldname", count:{$sum:1}}} ])