mongodb\Query min()

min() public method Returns the minimum of the specified column values. public integer min ( $q, $db = null )$q string The column name. Make sure you properly quote column names in the expression. $db yii\mongodb\Connection The database connection used to generate the SQL statement. If this parameter is not given, the db application component will be used. return integer The minimum of the specified column values.

mongodb\Query max()

max() public method Returns the maximum of the specified column values. public integer max ( $q, $db = null )$q string The column name. Make sure you properly quote column names in the expression. $db yii\mongodb\Connection The Mongo connection used to execute the query. If this parameter is not given, the mongodb application component will be used. return integer The maximum of the specified column values.

mongodb\Query getCollection()

getCollection() public method Returns the Mongo collection for this query. public yii\mongodb\Collection getCollection ( $db = null )$db yii\mongodb\Connection Mongo connection. return yii\mongodb\Collection Collection instance.

mongodb\Query from()

from() public method Sets the collection to be selected from. public $this from ( $collection )$collection return $this The query object itself.

mongodb\Query fetchRowsInternal()

fetchRowsInternal() protected method See also yii\mongodb\Query::fetchRows(). protected array|boolean fetchRowsInternal ( $cursor, $all )$cursor \MongoDB\Driver\Cursor Mongo cursor instance to fetch data from. $all boolean Whether to fetch all rows or only first one. return array|boolean Result.

mongodb\Query fetchRows()

fetchRows() protected method Fetches rows from the given Mongo cursor. protected array|boolean fetchRows ( $cursor, $all = true, $indexBy = null )$cursor \MongoDB\Driver\Cursor Mongo cursor instance to fetch data from. $all boolean Whether to fetch all rows or only first one. $indexBy string|callable The column name or PHP callback, by which the query results should be indexed by. return array|boolean Result. throws yii\mongodb\Exception on failure.

mongodb\Query exists()

exists() public method Returns a value indicating whether the query result contains any row of data. public boolean exists ( $db = null )$db yii\mongodb\Connection The Mongo connection used to execute the query. If this parameter is not given, the mongodb application component will be used. return boolean Whether the query result contains any row of data.

mongodb\Query each()

each() public method (available since version 2.1) Starts a batch query and retrieves data row by row. This method is similar to batch() except that in each iteration of the result, only one row of data is returned. For example, $query = (new Query)->from('user'); foreach ($query->each() as $row) { } public yii\mongodb\BatchQueryResult each ( $batchSize = 100, $db = null )$batchSize integer The number of records to be fetched in each batch. $db yii\mongodb\Connection The MongoDB

mongodb\Query distinct()

distinct() public method Returns a list of distinct values for the given column across a collection. public array distinct ( $q, $db = null )$q string Column to use. $db yii\mongodb\Connection The Mongo connection used to execute the query. If this parameter is not given, the mongodb application component will be used. return array Array of distinct values

mongodb\Query count()

count() public method Returns the number of records. public integer count ( $q = '*', $db = null )$q string Kept to match yii\db\QueryInterface, its value is ignored. $db yii\mongodb\Connection The Mongo connection used to execute the query. If this parameter is not given, the mongodb application component will be used. return integer Number of records throws yii\mongodb\Exception on failure.