For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

MongoDB\Client::removeSubscriber()

New in version 1.18. :

MongoDB\Client::removeSubscriber()

Unregisters a monitoring event subscriber with this Client.

function removeSubscriber(MongoDB\Driver\Monitoring\Subscriber $subscriber): void
$subscriber : MongoDB\Driver\Monitoring\Subscriber
A monitoring event subscriber to unregister with this Client.

MongoDB\Exception\InvalidArgumentException for errors related to the parsing of parameters or options.

If $subscriber is not registered with this Client, this function is a no-op.