Table of Contents

Method CommandAsync

Namespace
MongoDB.Driver.Core.Bindings
Assembly
MongoDB.Driver.Core.dll

CommandAsync<TResult>(ICoreSession, ReadPreference, DatabaseNamespace, BsonDocument, IEnumerable<Type1CommandMessageSection>, IElementNameValidator, BsonDocument, Action<IMessageEncoderPostProcessor>, CommandResponseHandling, IBsonSerializer<TResult>, MessageEncoderSettings, CancellationToken)

Executes a Command protocol.

Task<TResult> CommandAsync<TResult>(ICoreSession session, ReadPreference readPreference, DatabaseNamespace databaseNamespace, BsonDocument command, IEnumerable<Type1CommandMessageSection> commandPayloads, IElementNameValidator commandValidator, BsonDocument additionalOptions, Action<IMessageEncoderPostProcessor> postWriteAction, CommandResponseHandling responseHandling, IBsonSerializer<TResult> resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)

Parameters

session ICoreSession

The session.

readPreference ReadPreference

The read preference.

databaseNamespace DatabaseNamespace

The database namespace.

command BsonDocument

The command.

commandPayloads IEnumerable<Type1CommandMessageSection>

The command payloads.

commandValidator IElementNameValidator

The command validator.

additionalOptions BsonDocument

The additional options.

postWriteAction Action<IMessageEncoderPostProcessor>

The post write action.

responseHandling CommandResponseHandling

The response handling.

resultSerializer IBsonSerializer<TResult>

The result serializer.

messageEncoderSettings MessageEncoderSettings

The message encoder settings.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TResult>

A Task whose result is the result of the Command protocol.

Type Parameters

TResult

The type of the result.