Created
January 18, 2017 08:24
-
-
Save KekSfabrik/8af01e3a713fe47a29d6a215177ac58a to your computer and use it in GitHub Desktop.
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
var storageSize = 0 | |
db._adminCommand("listDatabases").databases.forEach(function (d) { | |
mdb = db.getSiblingDB(d.name); | |
mdb.getCollectionNames().forEach(function(c) { | |
s = mdb[c].stats(); | |
storageSize += s.storageSize | |
}) | |
}) | |
printjson((storageSize / 1024 / 1024 / 1024) + "GB") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment