mongo如何查看是否有重复数据
查询mongo中某一列的重复数据
·
db.getCollection('trade_content_collection').aggregate([{$group: { _id : '$trend_id', count: {$sum: 1}}}, {$match: {count: {$gt: 1}}}], {allowDiskUse: true})
查询语句的意思是 查看 trade_content_collection 表中 trend_id 列的重复数据
查询结果:会展示trend_id内容 以及重复的数据条数
更多推荐
已为社区贡献2条内容
所有评论(0)