Doctrine\MongoDB\Query\Builder::mapReduce PHP Method

mapReduce() public method

Change the query type to a mapReduce command.
See also: http://docs.mongodb.org/manual/reference/command/mapReduce/
public mapReduce ( string | MongoCode $map, string | MongoCode $reduce, array | string $out = ['inline' => true], array $options = [] )
$map string | MongoCode
$reduce string | MongoCode
$out array | string
$options array
    public function mapReduce($map, $reduce, $out = ['inline' => true], array $options = [])
    {
        $this->query['type'] = Query::TYPE_MAP_REDUCE;
        $this->query['mapReduce'] = ['map' => $map, 'reduce' => $reduce, 'out' => $out, 'options' => $options];
        return $this;
    }