Max BSON Document Size is 4MB when should be 16GB, Generating Read Errors

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 0.11
    • Affects Version/s: 0.9
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In MongoDB.Bson.BsonDefaults,
      private static int maxDocumentSize = 4 * 1024 * 1024; // 4MB

      should be:
      private static int maxDocumentSize = 4 * 1024 * 1024 * 4; // 4MB * 4 = 16MB

      Otherwise, during a Read, the ReadSize method throws an error:

      private int ReadSize() {
      int size = buffer.ReadInt32();
      if (size < 0)

      { throw new FileFormatException("Size is negative"); }

      if (size > settings.MaxDocumentSize)

      { throw new FileFormatException("Size is larger than MaxDocumentSize"); }

      return size;
      }

              Assignee:
              Robert Stam
              Reporter:
              Alex Kaminski
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: