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

bulk_write should be able to accept a generator

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: API, Write Ops
    • Labels:

      There are use cases where a generator is more convenient than passing a list of bulk write operations, for example when performing a large number of operation where creating the list would balloon memory usage.

      bulk_write should be able to accept a generator without inflating the entire thing to a list. This would also allow insert_many to support generators without inflating as well which is requested in PYTHON-1517.

      Some open questions:

      • What should be the behavior of unordered bulk_write where the generator flips flops between request types (Insert, Update, Insert, etc...)? I think it would be a performance regression to send each operation individually but sorting the operations from the generator without ballooning memory usage will be tricky.

            Assignee:
            Unassigned Unassigned
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: