Browse Source

Avoid using private API to fix regression (#307)

Andreas Braun 2 years ago
parent
commit
561496fca4
1 changed files with 6 additions and 2 deletions
  1. 6 2
      lib/Mongo/MongoCollection.php

+ 6 - 2
lib/Mongo/MongoCollection.php

@@ -1047,9 +1047,13 @@ class MongoCollection
      */
     private function generateIndexName($keys)
     {
-        $indexInput = new IndexInput(['key' => $keys]);
+        $name = '';
 
-        return (string) $indexInput;
+        foreach ($keys as $field => $type) {
+            $name .= ($name !== '' ? '_' : '') . $field . '_' . $type;
+        }
+
+        return $name;
     }
 
     /**