Table of Contents

Method Near

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Near(FieldDefinition<TDocument>, double, double, double?, double?)

Creates a near filter.

public FilterDefinition<TDocument> Near(FieldDefinition<TDocument> field, double x, double y, double? maxDistance = null, double? minDistance = null)

Parameters

field FieldDefinition<TDocument>

The field.

x double

The x.

y double

The y.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near filter.

Near(Expression<Func<TDocument, object>>, double, double, double?, double?)

Creates a near filter.

public FilterDefinition<TDocument> Near(Expression<Func<TDocument, object>> field, double x, double y, double? maxDistance = null, double? minDistance = null)

Parameters

field Expression<Func<TDocument, object>>

The field.

x double

The x.

y double

The y.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near filter.

Near<TCoordinates>(FieldDefinition<TDocument>, GeoJsonPoint<TCoordinates>, double?, double?)

Creates a near filter.

public FilterDefinition<TDocument> Near<TCoordinates>(FieldDefinition<TDocument> field, GeoJsonPoint<TCoordinates> point, double? maxDistance = null, double? minDistance = null) where TCoordinates : GeoJsonCoordinates

Parameters

field FieldDefinition<TDocument>

The field.

point GeoJsonPoint<TCoordinates>

The geometry.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near filter.

Type Parameters

TCoordinates

The type of the coordinates.

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

Creates a near filter.

public FilterDefinition<TDocument> Near<TCoordinates>(Expression<Func<TDocument, object>> field, GeoJsonPoint<TCoordinates> point, double? maxDistance = null, double? minDistance = null) where TCoordinates : GeoJsonCoordinates

Parameters

field Expression<Func<TDocument, object>>

The field.

point GeoJsonPoint<TCoordinates>

The geometry.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near filter.

Type Parameters

TCoordinates

The type of the coordinates.