MongoDB query to get the stats of all collections in all databases
To collect the stats of all the collections in all databases from a mongo shell, you can run below query. db.getMongo().getDBNames().forEach(function (d) { print(“Database: ” + d ); var curr_db = db.getSiblingDB(d); printjson( curr_db.stats() ); curr_db.getCollectionNames().forEach(function(coll) { print(“.. collection: ”…