collStats is a MongoDB diagnostic command for examining one collection’s document count, data size, index count, index performance, and related resource statistics. Use it to monitor collection health, evaluate storage use, and identify targets for performance or indexing improvements. section 21.2.3
Use collStats when you need to:
- Inspect collection-level storage and document statistics. section 21.2.3
- Review index counts and performance while investigating inefficient resource use. section 21.2.3
- Complement database-wide dbStats results with more focused collection-level detail. section 21.2.3
Inspect one collection
Run `db.runCommand({ collStats: "collection_name" })`. Review the returned document for collection size, document count, index counts, and related performance information. Use those measurements to identify storage or indexing areas that may need optimization. section 21.2.3
db.runCommand({ collStats: "collection_name" })
The command listing provides a copyable collStats invocation for a named collection. section 21.2.3
