Skip to main content

Connections

A Connections instance represents a pool of connections to your Zilliz Cloud clusters.

class pymilvus.Connections

Constructor

Constructs a singleton instance to manage all connections.

📘Notes

Instead of creating a new instance of this class on your own, import the existing singleton instance as shown in the following example.

Examples

from pymilvus import connections    

CLUSTER_ENDPOINT = "YOUR_CLUSTER_ENDPOINT"
TOKEN = "YOUR_TOKEN"

# Establish a connection
connections.connect(
uri=CLUSTER_ENDPOINT,
token=TOKEN,
)
📘How can I get the cluster endpoint and token?
  • Cluster endpoint

You can log into the Zilliz Cloud console and click Clusters in the left navigation pane. In the cluster list, click the name of the target cluster and copy its endpoint in the Connect area.

  • Access token

To connect to a Zilliz Cloud cluster, you can use either of the following

  • An API key

You can log into the Zilliz Cloud console and click API Keys in the left navigation pane.

  • A pair of username and password to access the cluster, joined by a colon (:).

You can use the cluster credentials specified when the cluster has been created on the Zilliz Cloud console, or those of any existing cluster users.

Methods

The following are the methods of the connections singleton instance: