Skip to content

Instantly share code, notes, and snippets.

@Voronenko
Created September 22, 2014 16:11
Show Gist options
  • Save Voronenko/5457c8d41735c7094118 to your computer and use it in GitHub Desktop.
Save Voronenko/5457c8d41735c7094118 to your computer and use it in GitHub Desktop.
Removes all collections inside mongo DB except the system one
db.getCollectionNames().forEach(function(c) { if (c.indexOf("system.") == -1) db[c].drop(); })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment