Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-327

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

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.0.0-alpha1
    • Component/s: None
    • Labels:
      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 Unassigned
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: