WWW.DBVERSITY.COM
WWW.DBVERSITY.COM
Menu
  • Home
  • About us
  • Discussions
  • Login / Register
Welcome to the world of Database Technologies
Browse: Home » MongoDB query to get the stats of all collections in all databases

MongoDB query to get the stats of all collections in all databases

December 28, 2015 · by dbversity · in MongoDB

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: ”…

Categories

Categories

Copyright © 2025 WWW.DBVERSITY.COM

Powered by WordPress and Origin