mongodb 学习

1、统计查询 eid记录重复 查询大于1 eid重复的记录

db.xiezi.aggregate( [ { $group: { _id: "$eid", count: { $sum: 1 } } }, { $match: { count: { $gt: 1 } } }] )
SELECT eid,
 count(*)
FROM xiezi BY eid HAVING count(*) > 1
原文地址:https://www.cnblogs.com/weiyiyong/p/11895807.html