Skip to content

Commit c991d3a

Browse files
committed
PHPLIB-91: Ensure count/distinct filters serialize as BSON objects
1 parent c520df8 commit c991d3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function count(array $filter = array(), array $options = array())
239239
{
240240
$cmd = array(
241241
"count" => $this->collname,
242-
"query" => $filter,
242+
"query" => (object) $filter,
243243
) + $options;
244244

245245
$doc = current($this->_runCommand($this->dbname, $cmd)->toArray());
@@ -363,7 +363,7 @@ public function distinct($fieldName, array $filter = array(), array $options = a
363363
$cmd = array(
364364
"distinct" => $this->collname,
365365
"key" => $fieldName,
366-
"query" => $filter,
366+
"query" => (object) $filter,
367367
) + $options;
368368

369369
$doc = current($this->_runCommand($this->dbname, $cmd)->toArray());

0 commit comments

Comments
 (0)