db.collection.dataSize()

db.collection. dataSize ( )
Returns: The size in bytes of the collection.

Data compression does not affect this value.

This method provides a wrapper around the size output of the collStats (i.e. db.collection.stats()) command.