-
-
Save dimi-kr/e5143bff7f90888b16d7d2c0038b1f30 to your computer and use it in GitHub Desktop.
Revisions
-
BlakeGardner revised this gist
Jan 21, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ // This script loops though the list of collection names in a MongoDB and runs the compact operation on them // Simply paste this into the Mongo shell use testDbName; db.getCollectionNames().forEach(function (collectionName) { -
BlakeGardner created this gist
Jan 21, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ use testDbName; db.getCollectionNames().forEach(function (collectionName) { print('Compacting: ' + collectionName); db.runCommand({ compact: collectionName }); });