Skip to content

Commit a033aca

Browse files
committed
MongoDB\Driver\BulkWrite now takes an options array
See: PHPC-444, HHVM-117
1 parent 81cd77b commit a033aca

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

src/Operation/BulkWrite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function __construct($databaseName, $collectionName, array $operations, a
207207
*/
208208
public function execute(Server $server)
209209
{
210-
$bulk = new Bulk($this->options['ordered']);
210+
$bulk = new Bulk(['ordered' => $this->options['ordered']]);
211211
$insertedIds = array();
212212

213213
foreach ($this->operations as $i => $operation) {

src/Operation/CreateIndexes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private function executeCommand(Server $server)
107107
*/
108108
private function executeLegacy(Server $server)
109109
{
110-
$bulk = new Bulk(true);
110+
$bulk = new Bulk(['ordered' => true]);
111111

112112
foreach ($this->indexes as $index) {
113113
$bulk->insert($index);

src/Operation/InsertMany.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct($databaseName, $collectionName, array $documents, ar
8787
*/
8888
public function execute(Server $server)
8989
{
90-
$bulk = new Bulk($this->options['ordered']);
90+
$bulk = new Bulk(['ordered' => $this->options['ordered']]);
9191
$insertedIds = array();
9292

9393
foreach ($this->documents as $i => $document) {

tests/Collection/BulkWriteFunctionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function testReplaceOneRequiresReplacementDocument()
202202
*/
203203
private function createFixtures($n)
204204
{
205-
$bulkWrite = new BulkWrite(true);
205+
$bulkWrite = new BulkWrite(['ordered' => true]);
206206

207207
for ($i = 1; $i <= $n; $i++) {
208208
$bulkWrite->insert(array(

tests/Collection/CollectionFunctionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function testFindOne()
8383
*/
8484
private function createFixtures($n)
8585
{
86-
$bulkWrite = new BulkWrite(true);
86+
$bulkWrite = new BulkWrite(['ordered' => true]);
8787

8888
for ($i = 1; $i <= $n; $i++) {
8989
$bulkWrite->insert(array(

tests/Collection/CrudSpec/FunctionalTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
1717
*/
1818
protected function createFixtures($n)
1919
{
20-
$bulkWrite = new BulkWrite(true);
20+
$bulkWrite = new BulkWrite(['ordered' => true]);
2121

2222
for ($i = 1; $i <= $n; $i++) {
2323
$bulkWrite->insert(array(

tests/Operation/FindOneFunctionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function provideTypeMapOptionsAndExpectedDocument()
4545
*/
4646
private function createFixtures($n)
4747
{
48-
$bulkWrite = new BulkWrite(true);
48+
$bulkWrite = new BulkWrite(['ordered' => true]);
4949

5050
for ($i = 1; $i <= $n; $i++) {
5151
$bulkWrite->insert([

0 commit comments

Comments
 (0)