mongosh appdb --eval 'db.runCommand({collStats: "users"})'

Category: Databases & SQL

mongosh appdb --eval 'db.runCommand({collStats: "users"})'

Show collection storage statistics

Reports the collection's size, document count, index sizes, and average object size. Compare with db.stats() for database-level totals. Useful before deciding whether a collection needs compaction.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.