7

I am not able increase file size more than 16 MB . I don't have option to create more than one document. I read many blogs regarding the same but, I do not got any particular solution. I want to adjust data in single file which is 30 MB in size

1 Answers1

5

From the docs (https://docs.mongodb.com/manual/reference/limits/#bson-documents):

BSON Document Size The maximum BSON document size is 16 megabytes.

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. See mongofiles and the documentation for your driver for more information about GridFS.

The only question remains: Are you sure you need a single document that large?

ymz
  • 6,602
  • 1
  • 20
  • 39
  • then GridFS it is :) – ymz Feb 16 '17 at 11:50
  • 1
    Is it a 16MB+ BSON document or just a BLOB of binary content like an image or PDF? – Frederik Heremans Feb 16 '17 at 11:50
  • 1
    @Fredrik - that is an excellent point! I **assumed** we are talking about pure data but as we all know - assuming is the mother of all fu***dups! you got my vote for that :) – ymz Feb 16 '17 at 11:52
  • It is only BSON document. – Niranjan Nimbarte Feb 16 '17 at 11:53
  • 1
    I am getting maximum BSON document size exceeds during AEM 6.1 to AEM 6.3 upgrade. Is there any way to resolve. – Vijay Marudhachalam Jan 07 '18 at 04:24
  • The only way seems to compile Mongo yourself run it on your servers(instead to use "cloud" services) – mike Nov 10 '18 at 13:20
  • 1
    "The maximum document size helps ensure..." - thanks, we have admins to 'ensure' rules. I'm a new user, is there anything else behind the corner I should watch before I invest significant amount of time in Mongo? – Michał Leon Feb 14 '20 at 19:42
  • In short: remember that most of time you store in your db un-indexed data that you are not really using (e.g. making your db a storage solution). The best strategy is to keep only indexed + query-able data at mongo and move the rest to a storage solution (you may also keep storage references as part of your data). If everything is held for queries - please make sure you create proper indexes and that you store your data in a way that ease the load when making queries over it. – ymz Feb 16 '20 at 09:04
  • 6
    16 MB that large? Hardware has improved over the last 5 years, data got bigger. What a showstopper. – bluenote10 Apr 02 '20 at 08:43