Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1982

pass invalid document to bson.errors.InvalidDocument

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.11
    • Affects Version/s: None
    • Component/s: BSON
    • Not Needed
    • 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?

      Today I faced bson.errors.InvalidDocument on an insert_many() call. My function inserts up to 500 documents at once with only a few containing dots in key names, which I can't control. I don't want to recursively check every key name in 500 documents for it may contain a dot before inserting. The alternative is to react on the error when it occurs, but then it's still difficult to find the documents causing the error. Therefore I'd like to suggest passing the invalid document to the InvalidDocument error, so I can easily find and check only its keys rather then all the 500.

      What do you think?

            Assignee:
            steve.silvester@mongodb.com Steve Silvester
            Reporter:
            aron.schmidt@bechtle.com Aron Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: