Просмотр исходного кода

Don’t pass projection field through to mongod if it’s an empty array

Rob Williams 8 лет назад
Родитель
Сommit
ba5ea5da94
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      lib/Alcaeus/MongoDbAdapter/AbstractCursor.php

+ 1 - 1
lib/Alcaeus/MongoDbAdapter/AbstractCursor.php

@@ -276,7 +276,7 @@ abstract class AbstractCursor
             $converter = 'convert' . ucfirst($option);
             $value = method_exists($this, $converter) ? $this->$converter() : $this->$option;
 
-            if ($value === null) {
+            if ($value === null || ($option === 'projection' && $value === [])) {
                 continue;
             }