See also: MongoDB\Collection::find()
See also: http://docs.mongodb.org/manual/tutorial/query-documents/
See also: http://docs.mongodb.org/manual/reference/operator/query-modifier/
Inheritance: implements Phalcon\Db\Adapter\MongoDB\Operation\Executable
Example #1
0
 /**
  * Finds documents matching the query.
  *
  * @see Find::__construct() for supported options
  * @see http://docs.mongodb.org/manual/core/read-operations-introduction/
  *
  * @param array|object $filter Query by which to filter documents
  * @param array        $options Additional options
  *
  * @return Cursor
  */
 public function find($filter = [], array $options = [])
 {
     if (!isset($options['readConcern'])) {
         $options['readConcern'] = $this->readConcern;
     }
     if (!isset($options['readPreference'])) {
         $options['readPreference'] = $this->readPreference;
     }
     if (!isset($options['typeMap'])) {
         $options['typeMap'] = $this->typeMap;
     }
     $operation = new Find($this->databaseName, $this->collectionName, $filter, $options);
     $server = $this->manager->selectServer($options['readPreference']);
     return $operation->execute($server);
 }