Explorar el Código

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

Rob Williams hace 8 años
padre
commit
ba5ea5da94
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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;
             }