View index and collection sizes
MongoDBMaintenanceCommand
db.customer.stats({ indexDetails: true })What it does
Reports the collection size, storage size and the size of each index.
When to use it
When analyzing storage usage and index cost.
Caution
Read-only command; no risk.