src/League/Monga/Query/Aggregation.php
public function project($projection)
    {
        if ($projection instanceof Closure) {
            $callback = $projection;
            $projection = new Projection();
            $callback($projection);
        }

        if ($projection instanceof Projection) {
            $projection = $projection->getProjection();
        }

        $this->pipeline[] = ['$project' => $projection];

        return $this;
    }
public function project($projection)
    {
        if ($projection instanceof Closure) {
            $callback = $projection;
            $projection = new Projection();
            $callback($projection);
        }

        if ($projection instanceof Projection) {
            $projection = $projection->getProjection();
        }

        $this->pipeline[] = ['$project' => $projection];

        return $this;
    }
public function project ( $ projection ) { if ( $ projection instanceof Closure ) { $ callback = $ projection ; $ projection = new Projection ( ) ; $ callback ( $ projection ) ; } if ( $ projection instanceof Projection ) { $ projection = $ projection -> getProjection ( ) ; } $ this -> pipeline [ ] = [ '$project' => $ projection ] ; return $ this ; }
Project the results.

@param array $projection projection

@return object $this
Project the results .