The MongoDB\Driver\Monitoring\CommandFailedEvent class
The MongoDB\Driver\Monitoring\CommandFailedEvent class encapsulates information about a failed command.
Intro
The MongoDB\Driver\Monitoring\CommandFailedEvent class encapsulates information about a failed command.
Class synopsis
Properties
hostThe hostname of the server that executed the command.
portThe port of the server that executed the command.
commandNameThe command name.
databaseNameThe database name.
durationThe duration of the command in microseconds. The duration is a calculated value that includes the time to send the message and receive the response from the server.
errorThe exception that was thrown when the command failed.
replyThe failure reply document returned by the server.
operationIdThe operation ID. This may be used to link events together such as bulk writes, which may dispatch multiple commands.
requestIdThe request ID. This may be used to associate this
MongoDB\Driver\Monitoring\CommandFailedEventwith a correspondingMongoDB\Driver\Monitoring\CommandStartedEvent.serviceIdThe service ID, or null if the server does not support it (i.e. not using load-balanced mode).
serverConnectionIdThe server connection ID, or null if not available.
Changelog
| Version | Description |
|---|---|
| PECL mongodb 2.3.0 | Added public readonly properties. The duration property replaces the getDurationMicros method. |
Commandfailedevent