Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1171

Allow command documents to exceed the max document size

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.12.1
    • Affects Version/s: None
    • Component/s: Command Operations
    • Labels:
      None

      Several commands, e.g. findAndModify, may be used to insert or replace a document that is up to the exact 16MB max BSON object size. MongoDB servers allow this, and therefore should be allowed by the driver for.

      Currently however the extra surrounding "envelope" bytes of the message cause the total payload size to exceed 16MB, tripping the OutMessage validation.

      Example stack trace:

      com.mongodb.MongoInternalException: DBObject of size 16777340 is over Max BSON size 16777216
          at com.mongodb.OutMessage.putObject(OutMessage.java:291)
          at com.mongodb.OutMessage.writeQuery(OutMessage.java:211)
          at com.mongodb.OutMessage.query(OutMessage.java:84)
          at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:285)
          at com.mongodb.DB.command(DB.java:262)
          at com.mongodb.DB.command(DB.java:229)
          at com.mongodb.DB.command(DB.java:214)
          ...
      

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            john.morales@mongodb.com John Morales (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: