Commit 0f7ded8f by Paul Klimov

Mongo query unit test fixed.

parent 37664fff
...@@ -253,7 +253,7 @@ class Collection extends Object ...@@ -253,7 +253,7 @@ class Collection extends Object
$result[] = $actualValue; $result[] = $actualValue;
} else { } else {
$key = $this->normalizeConditionKeyword($key); $key = $this->normalizeConditionKeyword($key);
if (strncmp('$', $key, 1) !== 0 && array_key_exists(0, $actualValue)) { if (strncmp('$', $key, 1) !== 0 && is_array($actualValue) && array_key_exists(0, $actualValue)) {
// shortcut for IN condition // shortcut for IN condition
$result[$key]['$in'] = $actualValue; $result[$key]['$in'] = $actualValue;
} else { } else {
......
...@@ -123,9 +123,10 @@ class Query extends Component implements QueryInterface ...@@ -123,9 +123,10 @@ class Query extends Component implements QueryInterface
*/ */
protected function buildCursor($db = null) protected function buildCursor($db = null)
{ {
$where = $this->where; if ($this->where === null) {
if (!is_array($where)) {
$where = []; $where = [];
} else {
$where = $this->where;
} }
$selectFields = []; $selectFields = [];
if (!empty($this->select)) { if (!empty($this->select)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment