Created
December 30, 2010 17:59
-
-
Save gatesvp/760056 to your computer and use it in GitHub Desktop.
Stolen from here: http://stackoverflow.com/questions/4555938/
Well done.
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 characters
| // Get a the current collection size. | |
| var storage = db.foo.storageSize(); | |
| var total = db.foo.totalSize(); | |
| print('Storage Size: ' + tojson(storage)); | |
| print('TotalSize: ' + tojson(total)); | |
| print('-----------------------'); | |
| print('Running db.repairDatabase()'); | |
| print('-----------------------'); | |
| // Run repair | |
| db.repairDatabase() | |
| // Get new collection sizes. | |
| var storage_a = db.foo.storageSize(); | |
| var total_a = db.foo.totalSize(); | |
| print('Storage Size: ' + tojson(storage_a)); | |
| print('TotalSize: ' + tojson(total_a)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment