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

DBObject of size (smaller than 16 mb) is over Max BSON size 16777216

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 3.0.0
    • 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()); }

            Assignee:
            Unassigned Unassigned
            Reporter:
            rohit.nijhawan@10gen.com rohit.nijhawan@10gen.com
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: