Mongo DB has a BSON document size restriction of 16mb and in it, the bin data type has a restriction of 4Mb. If I have to save 10Mb file should I go for GridFs or is there any other way to store it in BSON doc?
Asked
Active
Viewed 598 times
1 Answers
1
As my research BSON doc limit increased to 16 mb.
BSON Document Size The maximum document size helps ensure that a single document cannot use excessive amount of RAM or, during transmission, excessive amount of bandwidth. To store documents larger than the maximum size, MongoDB provides the GridFS API.
Because of that I thought there is no way to store it in BSON doc over 16 mb without go for gridfs.
For more information look at these :
stackoverflow.com/questions/4667597/understanding-mongodb-bson-document-size-limit

Community
- 1
- 1

burakozgul
- 775
- 6
- 11
-
correct me if I'm wrong, Isn't bin datatype bound by a limit? Or can one binary field in the document be the maximum size of the document? – Cybermonk Jul 15 '16 at 06:06
-
Bin datatype bound by a limit. If your document size over 16mb, gridfs divide document chunks. [Here](http://s3.amazonaws.com/info-mongodb-com/_com_assets/blog/gridfs1.png) a illustration which shows how gridfs store files. – burakozgul Jul 15 '16 at 10:51