mongosh appdb --eval 'db.stats()'

Category: Databases & SQL

mongosh appdb --eval 'db.stats()'

Show database statistics

Reports data size, index size, document counts, and storage engine for the current database. The admin equivalent is db.adminCommand({dbStats: 1}). A first look at whether a database is growing as expected.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.