===================================
MongoDB\\Client::removeSubscriber()
===================================

.. versionadded:: 1.18

.. default-domain:: mongodb

.. contents:: On this page
   :local:
   :backlinks: none
   :depth: 1
   :class: singlecol

Definition
----------

.. phpmethod:: MongoDB\Client::removeSubscriber()

   Unregisters a monitoring event subscriber with this Client.

   .. code-block:: php

      function removeSubscriber(MongoDB\Driver\Monitoring\Subscriber $subscriber): void

Parameters
----------

``$subscriber`` : :php:`MongoDB\Driver\Monitoring\Subscriber <class.mongodb-driver-monitoring-subscriber>`
  A monitoring event subscriber to unregister with this Client.

Errors/Exceptions
-----------------

.. include:: /includes/extracts/error-invalidargumentexception.rst

Behavior
--------

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

See Also
--------

- :phpmethod:`MongoDB\Client::addSubscriber()`
- :php:`Application Performance Monitoring (APM) <manual/en/mongodb.tutorial.apm>`
- :php:`MongoDB\Driver\Manager::removeSubscriber() <manual/en/mongodb-driver-manager.addsubscriber>`
- :php:`MongoDB\Driver\Monitoring\CommandSubscriber <manual/en/class.mongodb-driver-monitoring-commandsubscriber>`
