Skip to content

Instantly share code, notes, and snippets.

@hasantayyar
Created June 10, 2012 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasantayyar/2905745 to your computer and use it in GitHub Desktop.
Save hasantayyar/2905745 to your computer and use it in GitHub Desktop.
mongodb weekly maintenance script - compact
// compact all collections
db.getCollectionNames().forEach( function(c){ db[c].runCommand("compact"); } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment