milvus-logo
LFAI
< Docs
  • Python

using_database()

This method changes the default database.

A Milvus cluster ships with a default database named default. All collection operations are performed within the default database. You can use this method to change the default database.

Invocation

using_database(db_name, using="default")

Parameters

ParametersDescriptionTypeRequired
db_nameName of the data to be created.StringTrue
usingAlias of a connectionStringFalse

Returns

No returns

Examples

from pymilvus import connections, db

conn = connections.connect(host="127.0.0.1", port=19530)

db.using_database("books")

## You can directly use a database upon the connection as follows.
## However, the specified database should exist beforehand.
conn = connections.connect(host="127.0.0.1", port=19530, db_name="books")

Feedback

Was this page helpful?