A GeoJSON point may be provided as the first and only argument for
2dsphere queries. This single parameter may be a GeoJSON point object or
an array corresponding to the point's JSON representation. If GeoJSON is
used, the "spherical" option will default to true.
You can only use this as the first stage of a pipeline.
/** * Outputs documents in order of nearest to farthest from a specified point. * You can only use this as the first stage of a pipeline. * * @see http://docs.mongodb.org/manual/reference/operator/aggregation/geoNear/ * * @param float|array|Point $x * @param float $y * @return Stage\GeoNear */ public function geoNear($x, $y = null) { return $this->builder->geoNear($x, $y); }