Table of Contents

Method GeoNearAs

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

GeoNearAs<TDocument>(GeoNearArgs)

Runs a GeoNear command on this collection.

public virtual GeoNearResult<TDocument> GeoNearAs<TDocument>(GeoNearArgs args)

Parameters

args GeoNearArgs

The args.

Returns

GeoNearResult<TDocument>

A GeoNearResult<TDocument>.

Type Parameters

TDocument

The type to deserialize the documents as.

GeoNearAs<TDocument>(IMongoQuery, double, double, int)

Runs a GeoNear command on this collection.

[Obsolete("Use the overload of GeoNearAs that has a GeoNearArgs parameter instead.")]
public virtual GeoNearResult<TDocument> GeoNearAs<TDocument>(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<TDocument>

A GeoNearResult<TDocument>.

Type Parameters

TDocument

The type to deserialize the documents as.

GeoNearAs<TDocument>(IMongoQuery, double, double, int, IMongoGeoNearOptions)

Runs a GeoNear command on this collection.

[Obsolete("Use the overload of GeoNearAs that has a GeoNearArgs parameter instead.")]
public virtual GeoNearResult<TDocument> GeoNearAs<TDocument>(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

The GeoNear command options (usually a GeoNearOptionsDocument or constructed using the GeoNearOptions builder).

Returns

GeoNearResult<TDocument>

A GeoNearResult<TDocument>.

Type Parameters

TDocument

The type to deserialize the documents as.

GeoNearAs(Type, GeoNearArgs)

Runs a GeoNear command on this collection.

public virtual GeoNearResult GeoNearAs(Type documentType, GeoNearArgs args)

Parameters

documentType Type

The type to deserialize the documents as.

args GeoNearArgs

The args.

Returns

GeoNearResult

A GeoNearResult<TDocument>.

GeoNearAs(Type, IMongoQuery, double, double, int)

Runs a GeoNear command on this collection.

[Obsolete("Use the overload of GeoNearAs that has a GeoNearArgs parameter instead.")]
public virtual GeoNearResult GeoNearAs(Type documentType, IMongoQuery query, double x, double y, int limit)

Parameters

documentType Type

The type to deserialize the documents as.

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

A GeoNearResult<TDocument>.

GeoNearAs(Type, IMongoQuery, double, double, int, IMongoGeoNearOptions)

Runs a GeoNear command on this collection.

[Obsolete("Use the overload of GeoNearAs that has a GeoNearArgs parameter instead.")]
public virtual GeoNearResult GeoNearAs(Type documentType, IMongoQuery query, double x, double y, int limit, IMongoGeoNearOptions options)

Parameters

documentType Type

The type to deserialize the documents as.

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

The GeoNear command options (usually a GeoNearOptionsDocument or constructed using the GeoNearOptions builder).

Returns

GeoNearResult

A GeoNearResult<TDocument>.