Inspect size, object count, and storage metrics.
Section: Connect and navigate
Check database stats
javascript
javascript
db.stats()Explanation
Helpful for quick diagnostics and growth checks.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Connect and navigate
Get collection names programmatically
Return an array of collection names.
Connect with a MongoDB URI
Connect directly with a full connection string.