Table of Contents

Method Near

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

Near<TCoordinates>(string, GeoJsonPoint<TCoordinates>)

Tests that the value of the named element is near a point (see $near).

public static IMongoQuery Near<TCoordinates>(string name, GeoJsonPoint<TCoordinates> point) where TCoordinates : GeoJsonCoordinates

Parameters

name string

The name of the element to test.

point GeoJsonPoint<TCoordinates>

The point.

Returns

IMongoQuery

An IMongoQuery.

Type Parameters

TCoordinates

The type of the coordinates.

Near<TCoordinates>(string, GeoJsonPoint<TCoordinates>, double)

Tests that the value of the named element is near some location (see $near).

public static IMongoQuery Near<TCoordinates>(string name, GeoJsonPoint<TCoordinates> point, double maxDistance) where TCoordinates : GeoJsonCoordinates

Parameters

name string

The name of the element to test.

point GeoJsonPoint<TCoordinates>

The point.

maxDistance double

The max distance.

Returns

IMongoQuery

An IMongoQuery.

Type Parameters

TCoordinates

The type of the coordinates.

Near<TCoordinates>(string, GeoJsonPoint<TCoordinates>, double, bool)

Tests that the value of the named element is near some location (see $near).

public static IMongoQuery Near<TCoordinates>(string name, GeoJsonPoint<TCoordinates> point, double maxDistance, bool spherical) where TCoordinates : GeoJsonCoordinates

Parameters

name string

The name of the element to test.

point GeoJsonPoint<TCoordinates>

The point.

maxDistance double

The max distance.

spherical bool

if set to true then the query will be translated to $nearSphere.

Returns

IMongoQuery

An IMongoQuery.

Type Parameters

TCoordinates

The type of the coordinates.

Near(string, double, double)

Tests that the value of the named element is near some location (see $near).

public static IMongoQuery Near(string name, double x, double y)

Parameters

name string

The name of the element to test.

x double

The x value of the origin.

y double

The y value of the origin.

Returns

IMongoQuery

An IMongoQuery.

Near(string, double, double, double)

Tests that the value of the named element is near some location (see $near).

public static IMongoQuery Near(string name, double x, double y, double maxDistance)

Parameters

name string

The name of the element to test.

x double

The x value of the origin.

y double

The y value of the origin.

maxDistance double

The max distance.

Returns

IMongoQuery

An IMongoQuery.

Near(string, double, double, double, bool)

Tests that the value of the named element is near some location (see $near).

public static IMongoQuery Near(string name, double x, double y, double maxDistance, bool spherical)

Parameters

name string

The name of the element to test.

x double

The x value of the origin.

y double

The y value of the origin.

maxDistance double

The max distance.

spherical bool

if set to true then the query will be translated to $nearSphere.

Returns

IMongoQuery

An IMongoQuery.