Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions examples/manage_milvus_client/manage_milvus_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@ def shared_connections():
c_shared.append(tmp)
LOGGER.info(f" {i}th MilvusClient, alias to the server connection: {tmp._using}, results of list_collections: {tmp.list_collections()}")

# MilvusClient to differen database or with different user and token
# will create a new connection to Milvus server.
# MilvusClient with different database but same uri and authentication
# will share the same connection, but each client maintains its own database context
LOGGER.info("=============================")
c_testdb = MilvusClient(uri=URI, db_name=TEST_DB)
LOGGER.info(f"MilvusClient to test_db, alias to the server connection: {c_testdb._using}, results of list_collections: {c_testdb.list_collections()}")
LOGGER.info(
f"MilvusClient to test_db, alias to the server connection: {c_testdb._using}, "
f"results of list_collections: {c_testdb.list_collections()}"
)
LOGGER.info(
f"Note: c and c_testdb share the same connection (alias: {c._using} == {c_testdb._using}), "
f"but use different databases (default vs {TEST_DB})"
)

# MilvusClient object is safe to copy across threads
LOGGER.info("=============================")
Expand Down
Loading