mongodb 实现group by 多个key having count(*) >1

来源:互联网 发布:matlab矩阵拼接 编辑:程序博客网 时间:2024/05/22 14:06
db.sysRequestWrapper.aggregate(
    {"$group": {_id:{card:"$card",account:"$account"}, "count": { "$sum": 1 } } },
    {"$match": {"_id" :{ "$ne" : null } , "count" : {"$gt": 1} } }
)

原创粉丝点击