src/League/Monga/Query/Aggregation.php
public function match($filter)
    {
        if ($filter instanceof Closure) {
            // Store the callback
            $callback = $filter;

            // Set a new Where filter
            $filter = new Where();

            // Execute the callback
            $callback($filter);
        }

        if ($filter instanceof Where) {
            $filter = $filter->getWhere();
        }

        $this->pipeline[] = ['$match' => $filter];

        return $this;
    }
public function match($filter)
    {
        if ($filter instanceof Closure) {
            // Store the callback
            $callback = $filter;

            // Set a new Where filter
            $filter = new Where();

            // Execute the callback
            $callback($filter);
        }

        if ($filter instanceof Where) {
            $filter = $filter->getWhere();
        }

        $this->pipeline[] = ['$match' => $filter];

        return $this;
    }
public function match ( $ filter ) { if ( $ filter instanceof Closure ) { // Store the callback $ callback = $ filter ; // Set a new Where filter $ filter = new Where ( ) ; // Execute the callback $ callback ( $ filter ) ; } if ( $ filter instanceof Where ) { $ filter = $ filter -> getWhere ( ) ; } $ this -> pipeline [ ] = [ '$match' => $ filter ] ; return $ this ; }
Add a match operation to the pipeline

@param mixed $filter filter array / filter callback / Query\Where instance

@return object $this
Add a match operation to the pipeline