Skip to content

Commit c50d9a6

Browse files
committed
PHPLIB-85: Legacy index creation should use {w:1}
1 parent 85bef16 commit c50d9a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Operation/CreateIndexes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use MongoDB\Driver\Command;
66
use MongoDB\Driver\Server;
77
use MongoDB\Driver\BulkWrite as Bulk;
8+
use MongoDB\Driver\WriteConcern;
89
use MongoDB\Exception\InvalidArgumentException;
910
use MongoDB\Exception\RuntimeException;
1011
use MongoDB\Exception\UnexpectedTypeException;
@@ -113,6 +114,6 @@ private function executeLegacy(Server $server)
113114
$bulk->insert($index);
114115
}
115116

116-
$server->executeBulkWrite($this->databaseName . '.system.indexes', $bulk);
117+
$server->executeBulkWrite($this->databaseName . '.system.indexes', $bulk, new WriteConcern(1));
117118
}
118119
}

0 commit comments

Comments
 (0)