Table of Contents

Method Near

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

Near<TMember, TCoordinates>(Expression<Func<TDocument, TMember>>, GeoJsonPoint<TCoordinates>)

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

public IMongoQuery Near<TMember, TCoordinates>(Expression<Func<TDocument, TMember>> memberExpression, GeoJsonPoint<TCoordinates> point) where TCoordinates : GeoJsonCoordinates

Parameters

memberExpression Expression<Func<TDocument, TMember>>

The member expression.

point GeoJsonPoint<TCoordinates>

The point.

Returns

IMongoQuery

An IMongoQuery.

Type Parameters

TMember

The type of the member.

TCoordinates

The type of the coordinates.

Near<TMember, TCoordinates>(Expression<Func<TDocument, TMember>>, GeoJsonPoint<TCoordinates>, double)

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

public IMongoQuery Near<TMember, TCoordinates>(Expression<Func<TDocument, TMember>> memberExpression, GeoJsonPoint<TCoordinates> point, double maxDistance) where TCoordinates : GeoJsonCoordinates

Parameters

memberExpression Expression<Func<TDocument, TMember>>

The member expression.

point GeoJsonPoint<TCoordinates>

The point.

maxDistance double

The max distance.

Returns

IMongoQuery

An IMongoQuery.

Type Parameters

TMember

The member type.

TCoordinates

The type of the coordinates.

Near<TMember, TCoordinates>(Expression<Func<TDocument, TMember>>, GeoJsonPoint<TCoordinates>, double, bool)

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

public IMongoQuery Near<TMember, TCoordinates>(Expression<Func<TDocument, TMember>> memberExpression, GeoJsonPoint<TCoordinates> point, double maxDistance, bool spherical) where TCoordinates : GeoJsonCoordinates

Parameters

memberExpression Expression<Func<TDocument, TMember>>

The member expression.

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

TMember

The member type.

TCoordinates

The type of the coordinates.

Near<TMember>(Expression<Func<TDocument, TMember>>, double, double)

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

public IMongoQuery Near<TMember>(Expression<Func<TDocument, TMember>> memberExpression, double x, double y)

Parameters

memberExpression Expression<Func<TDocument, TMember>>

The member expression representing the element to test.

x double

The x value of the origin.

y double

The y value of the origin.

Returns

IMongoQuery

An IMongoQuery.

Type Parameters

TMember

The member type.

Near<TMember>(Expression<Func<TDocument, TMember>>, double, double, double)

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

public IMongoQuery Near<TMember>(Expression<Func<TDocument, TMember>> memberExpression, double x, double y, double maxDistance)

Parameters

memberExpression Expression<Func<TDocument, TMember>>

The member expression representing 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.

Type Parameters

TMember

The member type.

Near<TMember>(Expression<Func<TDocument, TMember>>, double, double, double, bool)

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

public IMongoQuery Near<TMember>(Expression<Func<TDocument, TMember>> memberExpression, double x, double y, double maxDistance, bool spherical)

Parameters

memberExpression Expression<Func<TDocument, TMember>>

The member expression representing 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 [spherical].

Returns

IMongoQuery

An IMongoQuery.

Type Parameters

TMember

The member type.