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
    • 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?

      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:
            shruti.sridhar@mongodb.com Shruti Sridhar (Inactive)
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: