/** * @inheritdoc * @return Cursor cursor for the search results */ public function find($condition = [], $fields = [], $options = []) { return new Cursor($this, parent::find($condition, $fields, $options)); }
/** * Finds all records in collection. * @param \yii\mongodb\Collection $collection * @param array $condition * @param array $fields * @return array rows */ protected function findAll($collection, $condition = [], $fields = []) { $cursor = $collection->find($condition, $fields); $result = []; foreach ($cursor as $data) { $result[] = $data; } return $result; }