Created
July 4, 2016 08:26
-
-
Save lolobosse/1b8cd4c534e8faa9551cdee9559e9d65 to your computer and use it in GitHub Desktop.
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
var i = 0; | |
db.getCollection('fs.files').find({}).forEach(function(element){ | |
if (!db.getCollection('_User').find({profilePicture: element.filename}).toArray().length > 0){ | |
i++; | |
db.getCollection('fs.files').remove({filename: element.filename}) | |
} | |
}) | |
print(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment