(self)
return self._server_property('address')
(host, port) of the current standalone, primary, or mongos, or None.

        Accessing :attr:`address` raises :exc:`~.errors.InvalidOperation` if
        the client is load-balancing among mongoses, since there is no single
        address. Use :attr:`nodes` instead.

        If the client is not connected, this will block until a connection is
        established or raise ServerSelectionTimeoutError if no server is
        available.

        .. versionadded:: 3.0
(host, port) of the current standalone, primary, or mongos, or None.
( host port ) of the current standalone primary or mongos or None .
def address(self):
        """(host, port) of the current standalone, primary, or mongos, or None.

        Accessing :attr:`address` raises :exc:`~.errors.InvalidOperation` if
        the client is load-balancing among mongoses, since there is no single
        address. Use :attr:`nodes` instead.

        If the client is not connected, this will block until a connection is
        established or raise ServerSelectionTimeoutError if no server is
        available.

        .. versionadded:: 3.0
        """
        topology_type = self._topology._description.topology_type
        if topology_type == TOPOLOGY_TYPE.Sharded:
            raise InvalidOperation(
                'Cannot use "address" property when load balancing among'
                ' mongoses, use "nodes" instead.')
        if topology_type not in (TOPOLOGY_TYPE.ReplicaSetWithPrimary,
                                 TOPOLOGY_TYPE.Single):
            return None
        return self._server_property('address')
def address ( self ) : topology_type = self . _topology . _description . topology_type if topology_type == TOPOLOGY_TYPE . Sharded : raise InvalidOperation ( 'Cannot use "address" property when load balancing among' ' mongoses, use "nodes" instead.' ) if topology_type not in ( TOPOLOGY_TYPE . ReplicaSetWithPrimary , TOPOLOGY_TYPE . Single ) : return None return self . _server_property ( 'address' )