Skip to content

Commit

Permalink
Avoid using private API to fix regression (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus authored Nov 29, 2023
1 parent 016ec62 commit 561496f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Mongo/MongoCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1047,9 +1047,13 @@ private function checkCollectionName($name)
*/
private function generateIndexName($keys)
{
$indexInput = new IndexInput(['key' => $keys]);
$name = '';

return (string) $indexInput;
foreach ($keys as $field => $type) {
$name .= ($name !== '' ? '_' : '') . $field . '_' . $type;
}

return $name;
}

/**
Expand Down

0 comments on commit 561496f

Please sign in to comment.