Skip to content

Commit 561496f

Browse files
authored
Avoid using private API to fix regression (#307)
1 parent 016ec62 commit 561496f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/Mongo/MongoCollection.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -1047,9 +1047,13 @@ private function checkCollectionName($name)
10471047
*/
10481048
private function generateIndexName($keys)
10491049
{
1050-
$indexInput = new IndexInput(['key' => $keys]);
1050+
$name = '';
10511051

1052-
return (string) $indexInput;
1052+
foreach ($keys as $field => $type) {
1053+
$name .= ($name !== '' ? '_' : '') . $field . '_' . $type;
1054+
}
1055+
1056+
return $name;
10531057
}
10541058

10551059
/**

0 commit comments

Comments
 (0)