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

pass invalid document to bson.errors.InvalidDocument

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • Not Needed

      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: