geoNear() public method

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.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/geoNear/
public geoNear ( float | array | GeoJson\Geometry\Point $x, float $y = null ) : Doctrine\MongoDB\Aggregation\Stage\GeoNear
$x float | array | GeoJson\Geometry\Point
$y float
return Doctrine\MongoDB\Aggregation\Stage\GeoNear
Example #1
0
 /**
  * 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);
 }