Table of Contents

Method GeoNear

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Legacy.dll

GeoNear(GeoNearArgs)

Runs a GeoNear command on this collection.

public virtual GeoNearResult<TDefaultDocument> GeoNear(GeoNearArgs args)

Parameters

args GeoNearArgs

The args.

Returns

GeoNearResult<TDefaultDocument>

A GeoNearResult<TDocument>.

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 IMongoQuery

The query (usually a QueryDocument or constructed using the Query builder).

x double

The x coordinate of the starting location.

y double

The y coordinate of the starting location.

limit int

The maximum number of results returned.

Returns

GeoNearResult<TDefaultDocument>

A GeoNearResult<TDocument>.

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 IMongoQuery

The query (usually a QueryDocument or constructed using the Query builder).

x double

The x coordinate of the starting location.

y double

The y coordinate of the starting location.

limit int

The maximum number of results returned.

options IMongoGeoNearOptions

Options for the GeoNear command (see GeoNearOptionsDocument, GeoNearOptionsWrapper, and the GeoNearOptions builder).

Returns

GeoNearResult<TDefaultDocument>

A GeoNearResult<TDocument>.