Преглед изворни кода

Avoid using private API to fix regression (#307)

Andreas Braun пре 2 година
родитељ
комит
561496fca4
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      lib/Mongo/MongoCollection.php

+ 6 - 2
lib/Mongo/MongoCollection.php

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