milvus-logo
LFAI
< Docs
  • Python

has_connection()

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

Request Syntax

has_connection(alias: str)

PARAMETERS:

  • alias (string) -

    [REQUIRED]

    A connection alias.

RETURN TYPE:

Boolean

RETURNS:

A Boolean value indicating whether the connection exists.

notes

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

from pymilvus import connections

connections.has_connection(alias="default")

# Output
# True