Table of Contents

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
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 CollectionNamespace

The collection namespace.

near BsonValue

The point for which to find the closest documents.

resultSerializer IBsonSerializer<TResult>

The result serializer.

messageEncoderSettings MessageEncoderSettings

The message encoder settings.

Properties

Collation

Gets or sets the collation.

public Collation Collation { get; set; }

Property Value

Collation

CollectionNamespace

Gets the collection namespace.

public CollectionNamespace CollectionNamespace { get; }

Property Value

CollectionNamespace

DistanceMultiplier

Gets or sets the distance multiplier.

public double? DistanceMultiplier { get; set; }

Property Value

double?

Filter

Gets or sets the filter.

public BsonDocument Filter { get; set; }

Property Value

BsonDocument

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

double?

MaxTime

Gets or sets the maximum time.

public TimeSpan? MaxTime { get; set; }

Property Value

TimeSpan?

MessageEncoderSettings

Gets the message encoder settings.

public MessageEncoderSettings MessageEncoderSettings { get; }

Property Value

MessageEncoderSettings

Near

Gets the point for which to find the closest documents.

public BsonValue Near { get; }

Property Value

BsonValue

ReadConcern

Gets or sets the read concern.

public ReadConcern ReadConcern { get; set; }

Property Value

ReadConcern

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 IReadBinding

The binding.

cancellationToken CancellationToken

The 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 IReadBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TResult>

A Task whose result is the result of the operation.