Created
January 27, 2014 05:32
-
-
Save shao1555/8643691 to your computer and use it in GitHub Desktop.
print disk usage per collections
This file contains 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
db.getCollectionNames().forEach( | |
function(n) { | |
stats = db.getCollection(n).stats(); | |
print([n, stats.size, stats.storageSize, stats.storageSize+stats.totalIndexSize, stats.totalIndexSize].join("\t")) | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment