This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Create a array to store all duplicate records ids*/ | |
var duplicates = []; | |
/** Start Aggregation pipeline*/ | |
db.collection.aggregate([ | |
{ | |
$match: { /** Add any filter here. Add index for filter keys*/ | |
filterKey: { | |
$exists: false | |
} |