MongoDB: db.collection.storageSize() method
db.collection.storageSize
The db.collection.storageSize() method is used to reports the total size used by the collection in bytes.
Syntax:
db.collection.storageSize()
Returns:
The total amount of storage allocated to this collection for document storage.
Sample document in the restaurants collection:
Example: MongoDB: db.collection.storageSize() method
Following example returns the storage size of the collection restaurants.
Output:
> db.restaurants.storageSize(); 22507520
Retrieve the restaurants data from here
Previous:
db.collection.stats() method
Next:
db.collection.totalSize() method
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics