title: Inserting more than 16mb document into Mongo db 3.0 using java
body: <p>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. </p>
  
  <p>Is there any other way we can accomplish this?</p>
  
  <p>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.</p>
  
  <p>Any suggestions would be very helpful!!! Thanks in Advance.</p>