About DocumentTooLarge

XMLWordPrintableJSON

    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      when I do insert_one operation with object

      {"key": "1" * 1024 * 1024 * 16}
      

      I will get an error like:

      pymongo.errors.WriteError: object to insert too large. size in bytes: 16777248, max size: 16777216
      

      then I do insert_one with

      {"key": "1" * 1024 * 1024 * 18}
      

      I will get:

      pymongo.errors.DocumentTooLarge: BSON document too large (18874451 bytes) - the connected server supports BSON document sizes up to 16793598 bytes.
      

      I mean, There are two Exceptions with one situation( document is too large). That seems strange.

      And there is a similar case on insert_many.

      when I set a big document as `doc1`, and do `insert_many([doc1, {}])`, I will get
      pymongo.errors.DocumentTooLarge. That seems ok. but when I do `insert_many([{}, doc1])`, I did get `pymongo.errors.AutoReconnect`.

      Then I read the source code of pymongo. I do know what is going on now. I just think, could it be better when I meet one kind of situation, I will get only one exception.

              Assignee:
              Unassigned
              Reporter:
              Martin Wu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: