I am surprised because I import json data into mongo. As a result, the json data is noticeably smaller than the collection stats size
. I did export (with mongoexport
) the collection into json file again and the collection size
is 2.4G when an exported json file is 1.8G. Expectation would be that the size
would be at least the same as json file. Any ideas to explain that? I have not found anything in the documentation.
From docs:
collStats.size
The total uncompressed size in memory of all records in a collection. The size does not include the size of any indexes associated with the collection, which the totalIndexSize field reports.
The scale argument affects this value. Data compression does not affect this value.
MongoDB version is 4.2. The docs have never been removed or updated. The only operation was insertMany
.