The limitation of one document in MongoDB is 4Mo. I have some documents really heavy with a lot of data.
How I know my document's size inside MongoDB with the ruby driver ?
To get the exact size (in bytes) of the document, stick to the Object. bsonsize() function.
The maximum BSON document size is 16MB or 16777216 bytes. All conversions should use base-2 scale, e.g. 1024 kilobytes = 1 megabyte. If maxCollectionSize is less than or nearly equal to the target collection, increase the chunk size to ensure successful initial sharding.
With its 16Mb limit, a MongoDB document can easily store around 2 million values of 64-bit numbers (also dates and booleans). But strings are a special case. Each UTF-8 character takes one byte.
Hi Federica, The maximum size an individual document can be in MongoDB is 16MB with a nested depth of 100 levels.
Or native Object.bsonsize(db.Foo.findOne());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With