Commit c991d3a3 authored by Jeremy Mikola's avatar Jeremy Mikola

PHPLIB-91: Ensure count/distinct filters serialize as BSON objects

parent c520df8a
...@@ -239,7 +239,7 @@ class Collection ...@@ -239,7 +239,7 @@ class Collection
{ {
$cmd = array( $cmd = array(
"count" => $this->collname, "count" => $this->collname,
"query" => $filter, "query" => (object) $filter,
) + $options; ) + $options;
$doc = current($this->_runCommand($this->dbname, $cmd)->toArray()); $doc = current($this->_runCommand($this->dbname, $cmd)->toArray());
...@@ -363,7 +363,7 @@ class Collection ...@@ -363,7 +363,7 @@ class Collection
$cmd = array( $cmd = array(
"distinct" => $this->collname, "distinct" => $this->collname,
"key" => $fieldName, "key" => $fieldName,
"query" => $filter, "query" => (object) $filter,
) + $options; ) + $options;
$doc = current($this->_runCommand($this->dbname, $cmd)->toArray()); $doc = current($this->_runCommand($this->dbname, $cmd)->toArray());
......
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