我有以下聚合:
var duplicatesCursor = db.users.aggregate({
$group: {
_id: "$model.email",
count: {$sum: 1}
}
}, {
$match: {
_id: {$ne: null},
count:{$gt:1}
}
});
我怎么能找到多少匹配?我假设的是:
print("Found duplicate emails: " + duplicatesCursor.length); // undefined