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

Var. is over Max BSON size 16777216

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • Environment:
      Manjaro Linux (Arch) - MongoDB 2.4.8-2


      I am working with Matlab + the Java driver. I want to write some really big data into my MongoDB on my PC.

      I want to write data via

      doc = BasicDBObject();
      doc.put('title', 'song_title');
      doc.put('song_data', xyz);

      into the DB. Writing small data into the DB is working fine, but I have a problem with big data.

      The data I want to write into the matrix is a matrix of 11,000,000x1.
      Because of limitations of BSON and MongoDB driver I get always the error:

      Error using mongodb_test (line 152)
      Java exception occurred:
      com.mongodb.MongoInternalException: DBObject of size 199421593 is over Max BSON size 16777216
      at com.mongodb.OutMessage.putObject(OutMessage.java:291)
      at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:239)
      at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:204)
      at com.mongodb.DBCollection.insert(DBCollection.java:148)
      at com.mongodb.DBCollection.insert(DBCollection.java:91)

      How can I store such a big file in the DB. The bandwith is not the big problem, because I am working in a local network. What can I change on the MongoDB driver or in bson for a successfull run?


            Unassigned Unassigned
            matl Tobias Mas
            0 Vote for this issue
            2 Start watching this issue