yii\mongodb\Collection::find PHP Method

find() public method

In order to perform "find" queries use Query class.
See also: Query
public find ( array $condition = [], array $fields = [], array $options = [] ) : MongoDB\Driver\Cursor
$condition array query condition
$fields array fields to be selected
$options array query options (available since 2.1).
return MongoDB\Driver\Cursor cursor for the search results
    public function find($condition = [], $fields = [], $options = [])
    {
        if (!empty($fields)) {
            $options['projection'] = $fields;
        }
        return $this->database->createCommand()->find($this->name, $condition, $options);
    }

Usage Example

Beispiel #1
0
 /**
  * @inheritdoc
  * @return Cursor cursor for the search results
  */
 public function find($condition = [], $fields = [], $options = [])
 {
     return new Cursor($this, parent::find($condition, $fields, $options));
 }
All Usage Examples Of yii\mongodb\Collection::find