Database Statistics
View comprehensive statistics about your MongoDB database including storage usage, collection counts, index sizes, and file system metrics. Database statistics help you monitor growth, optimize storage, and plan capacity for your database.
Access database statistics to monitor size, storage, and performance metrics:
The top section displays key metrics in easy-to-read cards that give you an instant snapshot of database health and size:
| Metric | Description | What It Tells You |
|---|---|---|
Collections |
Total number of collections in the database | How many separate data collections exist (excludes views) |
Views |
Total number of views in the database | How many virtual collections (aggregation-based views) are defined |
Objects |
Total number of documents across all collections | The total count of all BSON documents stored in the database |
Data Size |
Uncompressed size of all documents | Actual document data size before compression and padding |
Storage Size |
Compressed size of data on disk | How much disk space the data actually consumes (with compression) |
Indexes |
Total number of indexes across all collections | How many indexes are defined to optimize query performance |
Index Size |
Total disk space consumed by all indexes | How much storage is dedicated to indexes for fast queries |
Average Object Size |
Average size per document | Helps predict storage needs and identify bloated documents |
Total Size |
Combined storage + index size | Total disk footprint of the entire database |
A visual breakdown shows how storage is distributed across data, indexes, and free space. This helps you understand compression efficiency and storage allocation.
Additional file system information provides context about disk capacity:
The detailed grid displays all raw statistics returned by MongoDB's dbStats command, including advanced metrics:
| Field | Description |
|---|---|
freeStorageSize |
Free storage space available for reuse within allocated files (requires WiredTiger with freeStorage: 1) |
indexFreeStorageSize |
Free storage within index files available for reuse |
totalFreeStorageSize |
Total free storage across data and indexes |
scaleFactor |
Scaling factor for sizes (typically 1 for bytes) |
ok |
Success indicator (1 = success, 0 = error) |
Click the Refresh button to reload database statistics. Use this after bulk operations, imports, or index creation to see updated metrics. The refresh executes a new db.stats() command on the server.
Click on individual metric values to copy them to your clipboard for reporting or documentation purposes.
Export the statistics data to JSON or CSV format for external analysis, reporting, or archiving historical metrics.
compact to reclaim disk space (requires maintenance window).VisualLeaf executes the following MongoDB command to retrieve database statistics:
db.stats({ freeStorage: 1 })
The freeStorage: 1 option provides additional free storage metrics available in MongoDB 4.4+. Without this option, you'll only see basic storage totals.
Download and start managing your MongoDB databases with ease.
Download Free Trial