Skip to content

Commit 828bf22

Browse files
committed
Allow array/object for Collection::find() and findOne() $filter
1 parent 046f95b commit 828bf22

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Collection.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ public function dropIndexes()
292292
*
293293
* @see Find::__construct() for supported options
294294
* @see http://docs.mongodb.org/manual/core/read-operations-introduction/
295-
* @param array $filter Query by which to filter documents
296-
* @param array $options Additional options
295+
* @param array|object $filter Query by which to filter documents
296+
* @param array $options Additional options
297297
* @return Cursor
298298
*/
299-
public function find(array $filter = array(), array $options = array())
299+
public function find($filter = array(), array $options = array())
300300
{
301301
$operation = new Find($this->dbname, $this->collname, $filter, $options);
302302
$server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
@@ -309,11 +309,11 @@ public function find(array $filter = array(), array $options = array())
309309
*
310310
* @see FindOne::__construct() for supported options
311311
* @see http://docs.mongodb.org/manual/core/read-operations-introduction/
312-
* @param array $filter The find query to execute
313-
* @param array $options Additional options
312+
* @param array|object $filter Query by which to filter documents
313+
* @param array $options Additional options
314314
* @return object|null
315315
*/
316-
public function findOne(array $filter = array(), array $options = array())
316+
public function findOne($filter = array(), array $options = array())
317317
{
318318
$operation = new FindOne($this->dbname, $this->collname, $filter, $options);
319319
$server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));

0 commit comments

Comments
 (0)