db.collection.storageSize()

  • db.collection.storageSize()

mongo Shell Method

This page documents the mongo shell method, and doesnot refer to the MongoDB Node.js driver (or any other driver)method. For corresponding MongoDB driver API, refer to your specificMongoDB driver documentation instead.

Returns:The total amount of storage allocated to this collectionfor document storage.If collection data is compressed (which is thedefault for WiredTiger), the storage sizereflects the compressed size and may be smaller than thevalue returned by db.collection.dataSize().

Provides a wrapper around the storageSize fieldof the collStats (i.e. db.collection.stats())output.