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

pass invalid document to bson.errors.InvalidDocument

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.1
    • Component/s: BSON
    • Labels:

      Description

      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?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              aron.schmidt@bechtle.com Aron Schmidt
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: