Collection Statistics
View detailed statistics for individual MongoDB collections with a comprehensive 4-tab interface. Monitor document counts, storage usage, index performance, cache statistics, and identify optimization opportunities for your collection.
Access collection statistics to analyze a specific collection's performance:
Collection statistics are organized into four specialized tabs, each focusing on a different aspect of collection performance:
Click any tab to switch views. All tabs share the same refresh and auto-refresh controls.
The Overview tab displays the most important collection metrics at a glance, with stat cards and storage breakdown charts.
| Card | Metric | Description |
|---|---|---|
Documents |
Total document count | Number of documents stored in the collection (stats.count) |
Collection Size |
Uncompressed data size | Total size of all documents before compression (stats.size) |
Average Doc Size |
Average document size | Average size per document (stats.avgObjSize) |
Total Size |
Total disk footprint | Storage size + index size (stats.totalSize) |
Shows how storage is allocated across different components:
Displays additional collection metadata:
The Indexes tab provides detailed statistics for each index on the collection, helping you optimize query performance and manage index overhead.
| Metric | Description |
|---|---|
Index Name |
Name of the index (e.g., _id_, email_1, compound_index) |
Index Size |
Disk space consumed by this index (from stats.indexSizes) |
Index Type |
Type from index details (WiredTiger, btree, etc.) |
URI |
WiredTiger internal URI for the index |
Creation String |
WiredTiger creation configuration string |
Note: The _id index is automatically created by MongoDB and cannot be deleted. All other indexes are user-defined.
The Cache tab displays WiredTiger cache statistics, showing how efficiently MongoDB is caching this collection's data and indexes in memory.
| Metric | Source | Description |
|---|---|---|
Bytes in Cache |
wiredTiger.cache | Current bytes cached for this collection in WiredTiger cache |
Dirty Bytes |
wiredTiger.cache | Modified pages in cache not yet written to disk (cumulative) |
Bytes Read |
wiredTiger.cache | Total bytes read into cache from disk |
Bytes Written |
wiredTiger.cache | Total bytes written from cache to disk |
Pages Requested |
wiredTiger.cache | Total page requests from the cache |
Modified Pages Evicted |
wiredTiger.cache | Dirty pages evicted from cache (indicates memory pressure) |
Unmodified Pages Evicted |
wiredTiger.cache | Clean pages evicted from cache |
Additional metrics from the cache walk subsystem (stats.wiredTiger.cache_walk):
The Storage tab focuses on disk space allocation, efficiency, and detailed storage metrics for the collection.
| Metric | Description |
|---|---|
Storage Size |
Total allocated disk space for the collection (stats.storageSize) |
Free Storage |
Reclaimable space within allocated storage (stats.freeStorageSize) |
Storage Efficiency |
Percentage of allocated storage actually in use: (storageSize - freeStorageSize) / storageSize × 100 |
The storage allocation panel shows a breakdown of how disk space is used:
Storage efficiency indicates how well the allocated space is being utilized:
compactNote: Low efficiency often occurs after deleting many documents. Run the compact command during a maintenance window to reclaim space.
Enable the Auto-refresh checkbox to monitor collection statistics in real-time. When enabled:
Click the Refresh button to manually update statistics for the collection. This executes a new db.collection.stats() command on the server.
Check the Auto-refresh checkbox to enable automatic refreshing every 30 seconds. Useful for monitoring ongoing operations.
Click on any of the four tabs (Overview, Indexes, Cache, Storage) to view different aspects of collection statistics.
Click Open Shell in the Collection Statistics toolbar to launch a new MongoDB Shell tab already scoped to the current database and collection. VisuaLeaf pre-sets use <db> and drops your cursor next to db.<collection>, so you can immediately run ad-hoc commands like db.orders.stats({ scale: 1024 }) or db.orders.getIndexes() without navigating away from the statistics view.
Click New Connection from the Collection Statistics toolbar to open the Connection Manager dialog with the current connection's host, TLS, and auth settings pre-filled. Useful for:
prod-readonly) with different read preferences or a scoped user.After you save, the new connection appears in the sidebar and the current Collection Statistics tab stays open — nothing loses state.
db.collection.compact() during off-peak hours.VisualLeaf executes the following MongoDB command to retrieve collection statistics:
db.collection.stats({ scale: 1 })
The response includes detailed WiredTiger storage engine statistics for the collection, indexes, cache, and more.
Download and start managing your MongoDB databases with ease.
Download Free Trial