Method GeoNear
GeoNear(GeoNearArgs)
Runs a GeoNear command on this collection.
public virtual GeoNearResult<TDefaultDocument> GeoNear(GeoNearArgs args)
Parameters
args
GeoNearArgsThe args.
Returns
- GeoNearResult<TDefaultDocument>
GeoNear(IMongoQuery, double, double, int)
Runs a GeoNear command on this collection.
[Obsolete("Use the overload of GeoNear that takes a GeoNearArgs parameter instead.")]
public virtual GeoNearResult<TDefaultDocument> GeoNear(IMongoQuery query, double x, double y, int limit)
Parameters
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
x
doubleThe x coordinate of the starting location.
y
doubleThe y coordinate of the starting location.
limit
intThe maximum number of results returned.
Returns
- GeoNearResult<TDefaultDocument>
GeoNear(IMongoQuery, double, double, int, IMongoGeoNearOptions)
Runs a GeoNear command on this collection.
[Obsolete("Use the overload of GeoNear that takes a GeoNearArgs parameter instead.")]
public virtual GeoNearResult<TDefaultDocument> GeoNear(IMongoQuery query, double x, double y, int limit, IMongoGeoNearOptions options)
Parameters
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
x
doubleThe x coordinate of the starting location.
y
doubleThe y coordinate of the starting location.
limit
intThe maximum number of results returned.
options
IMongoGeoNearOptionsOptions for the GeoNear command (see GeoNearOptionsDocument, GeoNearOptionsWrapper, and the GeoNearOptions builder).
Returns
- GeoNearResult<TDefaultDocument>