yii\mongodb\Query::max PHP Method

max() public method

Returns the maximum of the specified column values.
public max ( string $q, Connection $db = null ) : integer
$q string the column name. Make sure you properly quote column names in the expression.
$db 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.
    public function max($q, $db = null)
    {
        return $this->aggregate($q, 'max', $db);
    }