Method NearSphere

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

NearSphere(FieldDefinition, double, double, double?, double?)

Creates a near sphere filter.

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

Parameters

field FieldDefinition

The field.

x double

The x.

y double

The y.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition

A near sphere filter.

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

Creates a near sphere filter.

public FilterDefinition<TDocument> NearSphere(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

A near sphere filter.

NearSphere(FieldDefinition, GeoJsonPoint, double?, double?)

Creates a near sphere filter.

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

Parameters

field FieldDefinition

The field.

point GeoJsonPoint

The geometry.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition

A near sphere filter.

Type Parameters

TCoordinates

The type of the coordinates.

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

Creates a near sphere filter.

public FilterDefinition<TDocument> NearSphere<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

The geometry.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition

A near sphere filter.

Type Parameters

TCoordinates

The type of the coordinates.