php8.5
Home/ Manual/ driver / monitoring/ The MongoDB\Driver\Monitoring\CommandSucceededEvent class

The MongoDB\Driver\Monitoring\CommandSucceededEvent class

The MongoDB\Driver\Monitoring\CommandSucceededEvent class encapsulates information about a successful command.

Intro

The MongoDB\Driver\Monitoring\CommandSucceededEvent class encapsulates information about a successful command.

Class synopsis

class MongoDB\Driver\Monitoring\CommandSucceededEvent { }

Properties

host

The hostname of the server that executed the command.

port

The port of the server that executed the command.

commandName

The command name.

databaseName

The database name.

duration

The 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.

reply

The reply document returned by the server.

operationId

The operation ID. This may be used to link events together such as bulk writes, which may dispatch multiple commands.

requestId

The request ID. This may be used to associate this MongoDB\Driver\Monitoring\CommandSucceededEvent with a corresponding MongoDB\Driver\Monitoring\CommandStartedEvent.

serviceId

The service ID, or null if the server does not support it (i.e. not using load-balanced mode).

serverConnectionId

The server connection ID, or null if not available.

Changelog

VersionDescription
PECL mongodb 2.3.0Added public readonly properties. The duration property replaces the getDurationMicros method.

Commandsucceededevent

In this section

Source: reference/mongodb/mongodb/driver/monitoring/commandsucceededevent.xml · from the official PHP manual (php/doc-en)