Table of Contents

Class GeoSearchOperation<TResult>

Namespace
MongoDB.Driver.Core.Operations
Assembly
MongoDB.Driver.Core.dll

Represents the geoSearch command.

[Obsolete("The geoSearch command was deprecated in server version 4.4.")]
public sealed class GeoSearchOperation<TResult> : IReadOperation<TResult>

Type Parameters

TResult

The type of the result.

Inheritance
GeoSearchOperation<TResult>
Implements
Inherited Members
Extension Methods

Constructors

GeoSearchOperation(CollectionNamespace, BsonValue, IBsonSerializer<TResult>, MessageEncoderSettings)

Initializes a new instance of the GeoSearchOperation<TResult> class.

public GeoSearchOperation(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

CollectionNamespace

Gets the collection namespace.

public CollectionNamespace CollectionNamespace { get; }

Property Value

CollectionNamespace

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>

Gets or sets the search.

public BsonDocument Search { get; set; }

Property Value

BsonDocument

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.