Experts.
I\'m new to MongoDB, but know enough to get my self in trouble.. case in point:
db.test.aggregate( [ {$group: {_id: {email: \"$email\", ge
Please use aggregate query in run command,it will allow to use allowDiskUse tag.
db.runCommand( { aggregate: "test", pipeline: [ {$group: {_id: {email: "$email", gender: "$gender"}, cnt: {$sum: 1}}}, {$group: {_id: "$_id.email", cnt: {$sum: 1}}}, {$match: {cnt: 2}} ], allowDiskUse: true } )