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

Allow command documents to exceed maxBsonObjectSize

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.0.0
    • None
    • Command Operations
    • None

    Description

      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)
          ...

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: