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

push() public method

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