Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<MongoDB\Driver\Monitoring\CommandStartedEvent::getHostMongoDB\Driver\Monitoring\CommandStartedEvent::getPort>
^MongoDB\Driver\Monitoring\CommandStartedEventLast updated: Mon, 26 Oct 2026

MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId

(mongodb >=1.3.0)

MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId — Returns the command's operation ID

Description

final public function MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId(): string

The operation ID is generated by the extension and may be used to link events together such as bulk write operations, which may have been split across several commands at the protocol level.

Note:

Since multiple commands may share the same operation ID, it is not reliable to use this value to associate event objects with each other. The request ID returned by MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId() should be used instead.

Parameters

This function has no parameters.

Return Values

Returns the command's operation ID.

Errors/Exceptions


<MongoDB\Driver\Monitoring\CommandStartedEvent::getHostMongoDB\Driver\Monitoring\CommandStartedEvent::getPort>
^MongoDB\Driver\Monitoring\CommandStartedEventLast updated: Mon, 26 Oct 2026