跳到主要内容
版本:v3.0.x

has_connection()

This operation checks if a connection with the given alias has already been established.

Request Syntax

Python
has_connection(alias: str)

PARAMETERS:

  • alias (string) -

    [REQUIRED]

    A connection alias.

RETURN TYPE:

Boolean

RETURNS:

A Boolean value indicating whether the connection exists.

An existing connection alias does not necessarily indicates that the corresponding connection has been established.

This operation evaluates to True only if the connection alias exists and the corresponding connection has been established.

EXCEPTIONS:

  • ConnectionConfigException

    This exception will be raised when the connection configuration is invalid.

Examples

Python
from pymilvus import connections

connections.has_connection(alias="default")

# Output
# True

The following operations are related to has_connection():