
- MongoDB Tutorial
- MongoDB - Home
- MongoDB - Overview
- MongoDB - Advantages
- MongoDB - Environment
- MongoDB - Data Modeling
- MongoDB - Create Database
- MongoDB - Drop Database
- MongoDB - Create Collection
- MongoDB - Drop Collection
- MongoDB - Data Types
- MongoDB - Insert Document
- MongoDB - Query Document
- MongoDB - Update Document
- MongoDB - Delete Document
- MongoDB - Projection
- MongoDB - Limiting Records
- MongoDB - Sorting Records
- MongoDB - Indexing
- MongoDB - Aggregation
- MongoDB - Replication
- MongoDB - Sharding
- MongoDB - Create Backup
- MongoDB - Deployment
- MongoDB - Java
- MongoDB - PHP
- Advanced MongoDB
- MongoDB - Relationships
- MongoDB - Database References
- MongoDB - Covered Queries
- MongoDB - Analyzing Queries
- MongoDB - Atomic Operations
- MongoDB - Advanced Indexing
- MongoDB - Indexing Limitations
- MongoDB - ObjectId
- MongoDB - Map Reduce
- MongoDB - Text Search
- MongoDB - Regular Expression
- Working with Rockmongo
- MongoDB - GridFS
- MongoDB - Capped Collections
- Auto-Increment Sequence
- MongoDB Useful Resources
- MongoDB - Questions and Answers
- MongoDB - Quick Guide
- MongoDB - Useful Resources
- MongoDB - Discussion
Get the storage size of a database in MongoDB?
To get the storage size of a database in MongoDB, use the stats() method.
At first, check the current database with the help of the following query −
> db;
The following is the output −
test
Here is the query to get the storage size of the database in MongoDB −
> db.stats()
The following is the output displaying the stats including the storage size −
The following is the output −
{ "db" : "test", "collections" : 114, "views" : 0, "objects" : 391, "avgObjSize" : 83.0076726342711, "dataSize" : 32456, "storageSize" : 3211264, "numExtents" : 0, "indexes" : 120, "indexSize" : 2494464, "fsUsedSize" : 126172377088, "fsTotalSize" : 199229435904, "ok" : 1 }
- Related Articles
- Get database data size in MongoDB?
- Get the size of a collection in MongoDB using conditions?
- Get the size of all the documents in a MongoDB query?
- How to get the size of the tables of a MySQL database?
- Get the real document BSON size in MongoDB?
- Changing storage type of table in SAP HANA database
- How to view storage configuration of Oracle database?
- How to create a DB2 database DBSET1 in the storage group STG1?
- How to save database in local storage of android webview?
- What is the maximum size of a document in MongoDB?
- How to get the equivalent for SELECT column1, column2 FROM tbl in MongoDB Database?
- How to drop a database in MongoDB?
- Display collections in a particular MongoDB database?
- Selecting database inside the JS in MongoDB?
- How Can I check the size of the tables in a particular MySQL database?

Advertisements