Table of Contents

Struct CommandFailedEvent

Namespace
MongoDB.Driver.Core.Events
Assembly
MongoDB.Driver.Core.dll

Occurs when a command has failed.

public struct CommandFailedEvent
Inherited Members

Constructors

CommandFailedEvent(string, DatabaseNamespace, Exception, long?, int, ConnectionId, ObjectId?, TimeSpan)

Initializes a new instance of the CommandFailedEvent struct.

public CommandFailedEvent(string commandName, DatabaseNamespace databaseNamespace, Exception exception, long? operationId, int requestId, ConnectionId connectionId, ObjectId? serviceId, TimeSpan duration)

Parameters

commandName string

Name of the command.

databaseNamespace DatabaseNamespace

The database namespace.

exception Exception

The exception.

operationId long?

The operation identifier.

requestId int

The request identifier.

connectionId ConnectionId

The connection identifier.

serviceId ObjectId?

The service identifier.

duration TimeSpan

The duration.

CommandFailedEvent(string, DatabaseNamespace, Exception, long?, int, ConnectionId, TimeSpan)

Initializes a new instance of the CommandFailedEvent struct.

public CommandFailedEvent(string commandName, DatabaseNamespace databaseNamespace, Exception exception, long? operationId, int requestId, ConnectionId connectionId, TimeSpan duration)

Parameters

commandName string

Name of the command.

databaseNamespace DatabaseNamespace

The database namespace.

exception Exception

The exception.

operationId long?

The operation identifier.

requestId int

The request identifier.

connectionId ConnectionId

The connection identifier.

duration TimeSpan

The duration.

Properties

CommandName

Gets the name of the command.

public string CommandName { get; }

Property Value

string

ConnectionId

Gets the connection identifier.

public ConnectionId ConnectionId { get; }

Property Value

ConnectionId

DatabaseNamespace

Gets the database namespace.

public DatabaseNamespace DatabaseNamespace { get; }

Property Value

DatabaseNamespace

Duration

Gets the duration.

public TimeSpan Duration { get; }

Property Value

TimeSpan

Failure

Gets the exception.

public Exception Failure { get; }

Property Value

Exception

OperationId

Gets the operation identifier.

public long? OperationId { get; }

Property Value

long?

RequestId

Gets the request identifier.

public int RequestId { get; }

Property Value

int

ServiceId

Gets the service identifier.

public ObjectId? ServiceId { get; }

Property Value

ObjectId?

Timestamp

Gets the timestamp.

public DateTime Timestamp { get; }

Property Value

DateTime