Created
July 27, 2017 17:56
-
-
Save arthuralvim/2ab65374ec71629acc0260ab1ea158bc to your computer and use it in GitHub Desktop.
Remove mongo ids from specific collection.
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 mongo_ids = [ | |
ObjectId("596cc5e54060d2999dd2ffb2"), | |
... | |
]; | |
db.getCollection('collection_name').remove({ | |
_id: { | |
$nin: mongo_ids | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment