-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 2.11.0, 3.0.0
-
Component/s: Connection Management
-
Labels:None
-
Environment:Java Driver on linux, osx with mongo 2.4.2
Exception in thread "main" com.mongodb.MongoInternalException: DBObject of size 5242897 is over Max BSON size 16777216
Perhaps it IS the intended behaviour to not allow queries or remove operation's query parameters to exceed 4mb - the limit in Bytes.MAX_OBJECT_SIZE, but this message is very strange, and can easily throw off a developer.
Note that in OutMessage.java we check max on one thing _mongo.getConnector().getMaxBsonObjectSize()
...but report it on something else - which incidentally initializes it correctly.
_mongo.getMaxBsonObjectSize()
if (objectSize > Math.max(_mongo.getConnector().getMaxBsonObjectSize(), Bytes.MAX_OBJECT_SIZE))
{ throw new MongoInternalException("DBObject of size " + objectSize + " is over Max BSON size " + _mongo.getMaxBsonObjectSize()); }