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

maxDistance() public method

If the query is a geoNear command ({@link Expr::geoNear()} was called), the "maxDistance" command option will be set; otherwise, $maxDistance will be added to the current expression. If the query uses GeoJSON points, $maxDistance will be interpreted in meters. If legacy point coordinates are used, $maxDistance will be interpreted in radians.
See also: Expr::maxDistance()
See also: http://docs.mongodb.org/manual/reference/command/geoNear/
See also: http://docs.mongodb.org/manual/reference/operator/maxDistance/
See also: http://docs.mongodb.org/manual/reference/operator/near/
See also: http://docs.mongodb.org/manual/reference/operator/nearSphere/
public maxDistance ( float $maxDistance )
$maxDistance float
    public function maxDistance($maxDistance)
    {
        if ($this->query['type'] === Query::TYPE_GEO_NEAR) {
            $this->query['geoNear']['options']['maxDistance'] = $maxDistance;
        } else {
            $this->expr->maxDistance($maxDistance);
        }
        return $this;
    }