Skip to content

Instantly share code, notes, and snippets.

@tairov
Created April 18, 2013 08:13
Show Gist options
  • Save tairov/5411066 to your computer and use it in GitHub Desktop.
Save tairov/5411066 to your computer and use it in GitHub Desktop.
stats, all collections, all databases, mongodb
/opt/mongodb/bin/mongo --port 27017 --eval "db._adminCommand(\"listDatabases\").databases.forEach(function (d) {mdb = db.getSiblingDB(d.name); mdb.getCollectionNames().forEach(function(c) {s = mdb[c].stats(1024 * 1024); printjson(s)})})" | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment