[JAVA-1189] Allow command documents to exceed maxBsonObjectSize Created: 28/Apr/14  Updated: 08/Nov/18  Resolved: 19/Jun/14

Status: Closed
Project: Java Driver
Component/s: Command Operations
Affects Version/s: None
Fix Version/s: 3.0.0

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to JAVA-1171 Allow command documents to exceed the... Closed
is related to RUBY-1151 Commands should have a limit of maxBs... Closed

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



 Comments   
Comment by Jeffrey Yemin [ 31/Mar/15 ]

Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released.

Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1189: Allow commands to exceed the maximum document size by 16K, so that commands like findAndModify with a 16MB document will not throw.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/489ac81c8152ac8b44fa0884acd2165082ed4a89

Comment by Githook User [ 19/Jun/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1189: Allow commands to exceed the maximum document size by 16K, so that commands like findAndModify with a 16MB document will not throw.
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/489ac81c8152ac8b44fa0884acd2165082ed4a89

Comment by Jeffrey Yemin [ 28/Apr/14 ]

Created this as a separate issue from JAVA-1171 for porting to 3.0.

Generated at Thu Feb 08 08:54:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.