(self)
Disconnect from MongoDB.

        Close all sockets in the connection pools and stop the monitor threads.
        If this instance is used again it will be automatically re-opened and
        the threads restarted.
Disconnect from MongoDB.
Disconnect from MongoDB .
def close(self):
        """Disconnect from MongoDB.

        Close all sockets in the connection pools and stop the monitor threads.
        If this instance is used again it will be automatically re-opened and
        the threads restarted.
        """
        # Run _process_periodic_tasks to send pending killCursor requests
        # before closing the topology.
        self._process_periodic_tasks()
        self._topology.close()
def close ( self ) : # Run _process_periodic_tasks to send pending killCursor requests # before closing the topology. self . _process_periodic_tasks ( ) self . _topology . close ( )