语法:
db.getCollection('tableName').aggregate([{$match: {publistTime:{"$gt":20230701}},{$group: { _id : '$XX,count: {$sum: 1}}}, {$match: {count: {$gt: 1}}}], {allowDiskUse: true})
释义:aggregate中第一个$match为查询的过滤条件,该语句作用为查找出数据库中国满足过滤条件的某字段(XX)重复 的所有值
语法:
db.getCollection('tableName').aggregate([{$match: {publistTime:{"$gt":20230701}},{$group: { _id : '$XX,count: {$sum: 1}}}, {$match: {count: {$gt: 1}}}], {allowDiskUse: true})
释义:aggregate中第一个$match为查询的过滤条件,该语句作用为查找出数据库中国满足过滤条件的某字段(XX)重复 的所有值