I've been evaluating Mongo db 3.0 in java and encountered a scenario where in the document size has exceeded 16MB. The scenario is such that I've a list of primary keys(unique records) which should be in a document as embedded collection with some additional fields. When the pk's exceed 16k, we get the error saying the document size has been exceeded. I know that we can keep the collection outside of the document instead of embedding it, but since it is required in our scenario we have it this way. If we keep it outside of the document as a separate collection, it works fine, but the inserts/updates are becoming very very slow since it has to search all the pk's and the insert/update.
Is there any other way we can accomplish this?
I know that we can use gridfs for this, but as I've seen the examples it is mainly used for storing the images/videos etc in a file system. This is certainly not how we want to do it.
Any suggestions would be very helpful!!! Thanks in Advance.
Here is the official documentation :
MongoDB Limits and Thresholds
They suggest also to use GridFS when you exceed the size limit of BSON object(16 mbytes). GridFS is not only used for media files, but all kind of binary content.
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