Skip to content

Commit 7ba1966

Browse files
committed
PHPLIB-63: Fix index creation for legacy servers
This can be removed for PHPLIB-87 once PHPC-274 is resolved.
1 parent 3df5e5e commit 7ba1966

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Collection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,8 @@ private function createIndexesLegacy(Server $server, array $indexes)
12301230
$bulk = new BulkWrite(true);
12311231

12321232
foreach ($indexes as $index) {
1233-
$bulk->insert($index);
1233+
// TODO: Remove this once PHPC-274 is resolved (see: PHPLIB-87)
1234+
$bulk->insert($index->bsonSerialize());
12341235
}
12351236

12361237
$server->executeBulkWrite($this->dbname . '.system.indexes', $bulk);

0 commit comments

Comments
 (0)