The MongoDB\Driver\Monitoring\CommandStartedEvent class
(mongodb >=1.3.0)
Introduction
The MongoDB\Driver\Monitoring\CommandStartedEvent class encapsulates information about a started 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.
commandThe command document.
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\CommandStartedEvent with a corresponding MongoDB\Driver\Monitoring\CommandSucceededEvent or MongoDB\Driver\Monitoring\CommandFailedEvent.
serviceId
The service ID, or null if the server does not support it (i.e.
not using load-balanced mode).
The server connection ID, or null if not available.
Changelog
| Version | Description |
|---|---|
| PECL mongodb 2.3.0 | Added public readonly properties. |
Table of Contents
- MongoDB\Driver\Monitoring\CommandStartedEvent::getCommand — Returns the command document
- MongoDB\Driver\Monitoring\CommandStartedEvent::getCommandName — Returns the command name
- MongoDB\Driver\Monitoring\CommandStartedEvent::getDatabaseName — Returns the database on which the command was executed
- MongoDB\Driver\Monitoring\CommandStartedEvent::getHost — Returns the server hostname for the command
- MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId — Returns the command's operation ID
- MongoDB\Driver\Monitoring\CommandStartedEvent::getPort — Returns the server port for the command
- MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId — Returns the command's request ID
- MongoDB\Driver\Monitoring\CommandStartedEvent::getServer — Returns the Server on which the command was executed
- MongoDB\Driver\Monitoring\CommandStartedEvent::getServerConnectionId — Returns the server connection ID for the command
- MongoDB\Driver\Monitoring\CommandStartedEvent::getServiceId — Returns the load balancer service ID for the command
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
