Un-ordered bulks result in as many round-trips as ordered

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.0.0-alpha1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      <?php
      $a = $b = $c = $d = $e = $f = $g = $h = array("my" => "document");
      $obj = array("document" => "my");
      
      $bulk = new MongoDB\Driver\BulkWrite(true);
      $bulk->insert($a);
      $bulk->insert($b);
      $bulk->update($c, $obj);
      $bulk->update($d, $obj);
      $bulk->delete($e);
      $bulk->delete($f);
      $bulk->update($g, $obj);
      $bulk->delete($h);
      var_dump(count($bulk));
      ?>
      
      <?php
      $a = $b = $c = $d = $e = $f = $g = $h = array("my" => "document");
      $obj = array("document" => "my");
      
      $bulk = new MongoDB\Driver\BulkWrite(false);
      $bulk->insert($a);
      $bulk->insert($b);
      $bulk->update($c, $obj);
      $bulk->update($d, $obj);
      $bulk->delete($e);
      $bulk->delete($f);
      $bulk->update($g, $obj);
      $bulk->delete($h);
      var_dump(count($bulk));
      ?>
      

      Both of the above example result in 5 round-trips.
      I would only have expected 3 round-trips as the update operations should have been merged, and so the delete bulks.

              Assignee:
              Unassigned
              Reporter:
              Hannes Magnusson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: