Sokil\Mongo\Pipeline\GroupStage::max PHP Method

max() public method

Returns the highest value that results from applying an expression to each document in a group of documents that share the same group by key.
public max ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage
$field string
$expression literal | callable | Sokil\Mongo\Pipeline\Expression Expression
return GroupStage
    public function max($field, $expression)
    {
        $this->stage[$field]['$max'] = Expression::normalize($expression);
        return $this;
    }