Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-523

mongoc doesn't coalesce updates or deletes, only inserts

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.6
    • Affects Version/s: None
    • Component/s: Bulk API, libmongoc
    • None

      When creating a batch of writes using the bulk interface, only inserts are coalesced, resulting in far many updates and delete roundtrips then expected.

      bulk = mongoc_collection_create_bulk_operation()
      mongoc_bulk_operation_insert(bulk, document1);
      mongoc_bulk_operation_insert(bulk, document2);
      mongoc_bulk_operation_insert(bulk, document3);
      mongoc_bulk_operation_execute(bulk);
      

      Results in 1 round trip.

      bulk = mongoc_collection_create_bulk_operation()
      mongoc_bulk_operation_update(bulk, selector1, document1);
      mongoc_bulk_operation_update(bulk, selector2, document2);
      mongoc_bulk_operation_update(bulk, selector3, document3);
      mongoc_bulk_operation_execute(bulk);
      

      Results in 3 round trip.

      bulk = mongoc_collection_create_bulk_operation()
      mongoc_bulk_operation_delete(bulk, selector1);
      mongoc_bulk_operation_delete(bulk, selector2,);
      mongoc_bulk_operation_delete(bulk, selector3);
      mongoc_bulk_operation_execute(bulk);
      

      Results in 3 round trip.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: