Class GeoNearOperation<TResult>
- Namespace
- MongoDB.Driver.Core.Operations
- Assembly
- MongoDB.Driver.Core.dll
Represents the geoNear command.
public sealed class GeoNearOperation<TResult> : IReadOperation<TResult>
Type Parameters
TResult
The type of the result.
- Inheritance
-
GeoNearOperation<TResult>
- Implements
-
IReadOperation<TResult>
- Inherited Members
- Extension Methods
Constructors
GeoNearOperation(CollectionNamespace, BsonValue, IBsonSerializer<TResult>, MessageEncoderSettings)
Initializes a new instance of the GeoNearOperation<TResult> class.
public GeoNearOperation(CollectionNamespace collectionNamespace, BsonValue near, IBsonSerializer<TResult> resultSerializer, MessageEncoderSettings messageEncoderSettings)
Parameters
collectionNamespace
CollectionNamespaceThe collection namespace.
near
BsonValueThe point for which to find the closest documents.
resultSerializer
IBsonSerializer<TResult>The result serializer.
messageEncoderSettings
MessageEncoderSettingsThe message encoder settings.
Properties
Collation
Gets or sets the collation.
public Collation Collation { get; set; }
Property Value
CollectionNamespace
Gets the collection namespace.
public CollectionNamespace CollectionNamespace { get; }
Property Value
DistanceMultiplier
Gets or sets the distance multiplier.
public double? DistanceMultiplier { get; set; }
Property Value
Filter
Gets or sets the filter.
public BsonDocument Filter { get; set; }
Property Value
IncludeLocs
Gets or sets whether to include the locations of the matching documents.
public bool? IncludeLocs { get; set; }
Property Value
- bool?
Limit
Gets or sets the limit.
public int? Limit { get; set; }
Property Value
- int?
MaxDistance
Gets or sets the maximum distance.
public double? MaxDistance { get; set; }
Property Value
MaxTime
Gets or sets the maximum time.
public TimeSpan? MaxTime { get; set; }
Property Value
MessageEncoderSettings
Gets the message encoder settings.
public MessageEncoderSettings MessageEncoderSettings { get; }
Property Value
Near
Gets the point for which to find the closest documents.
public BsonValue Near { get; }
Property Value
ReadConcern
Gets or sets the read concern.
public ReadConcern ReadConcern { get; set; }
Property Value
ResultSerializer
Gets the result serializer.
public IBsonSerializer<TResult> ResultSerializer { get; }
Property Value
- IBsonSerializer<TResult>
Spherical
Gets or sets whether to use spherical geometry.
public bool? Spherical { get; set; }
Property Value
- bool?
UniqueDocs
Gets or sets whether to return a document only once.
public bool? UniqueDocs { get; set; }
Property Value
- bool?
Methods
Execute(IReadBinding, CancellationToken)
Executes the operation.
public TResult Execute(IReadBinding binding, CancellationToken cancellationToken)
Parameters
binding
IReadBindingThe binding.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- TResult
The result of the operation.
ExecuteAsync(IReadBinding, CancellationToken)
Executes the operation.
public Task<TResult> ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)
Parameters
binding
IReadBindingThe binding.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<TResult>
A Task whose result is the result of the operation.