Skip to content

Instantly share code, notes, and snippets.

@masasdani
Created July 15, 2016 06:59
Show Gist options
  • Select an option

  • Save masasdani/b13a5a453d62b64f3859f2389c1bd56c to your computer and use it in GitHub Desktop.

Select an option

Save masasdani/b13a5a453d62b64f3859f2389c1bd56c to your computer and use it in GitHub Desktop.

Revisions

  1. masasdani created this gist Jul 15, 2016.
    4 changes: 4 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    //this will remove all collection except system.*
    use <name_of_database>
    db.getCollectionNames().forEach(function(c) { if (c.indexOf("system.") == -1) db[c].drop(); })