Click or drag to resize
IChannelCommandAsyncTResult Method
Executes a Command protocol.

Namespace: MongoDB.Driver.Core.Bindings
Assembly: MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.3.0
Syntax
Task<TResult> CommandAsync<TResult>(
	DatabaseNamespace databaseNamespace,
	BsonDocument command,
	IElementNameValidator commandValidator,
	Func<CommandResponseHandling> responseHandling,
	bool slaveOk,
	IBsonSerializer<TResult> resultSerializer,
	MessageEncoderSettings messageEncoderSettings,
	CancellationToken cancellationToken
)

Parameters

databaseNamespace
Type: MongoDB.DriverDatabaseNamespace
The database namespace.
command
Type: MongoDB.BsonBsonDocument
The command.
commandValidator
Type: MongoDB.Bson.IOIElementNameValidator
The command validator.
responseHandling
Type: SystemFuncCommandResponseHandling
The response handling.
slaveOk
Type: SystemBoolean
if set to true sets the SlaveOk bit to true in the command message sent to the server.
resultSerializer
Type: MongoDB.Bson.SerializationIBsonSerializerTResult
The result serializer.
messageEncoderSettings
Type: MongoDB.Driver.Core.WireProtocol.Messages.EncodersMessageEncoderSettings
The message encoder settings.
cancellationToken
Type: System.ThreadingCancellationToken
The cancellation token.

Type Parameters

TResult
The type of the result.

Return Value

Type: TaskTResult
A Task whose result is the result of the Command protocol.
See Also