create_database()
This operation creates a database.
Request Syntax
create_database(
db_name: str,
properties: Optional[dict] = None,
timeout: Optional[float] = None,
**kwargs,
)
PARAMETERS:
db_name (string) -
[REQUIRED]
Name of the database to create.
properties (dict | None) -
Properties of the database to be created. Possible database properties are as follows:
database.replica.number (int) -
Number of replicas for the database.
database.resource_groups ([]str) -
Resource groups dedicated to the database.
database.diskQuota.mb (int) -
Disk quota allocated to the database in megabytes (MB).
database.max.collections (int) -
Maximum number of collections allowed in the database.
database.force.deny.writing (bool) -
Whether to deny all write operations in the database.
database.force.deny.reading (bool) -
Whether to deny all read operations in the database.
timeout (float | None) -
The timeout duration for this operation. Setting this to None indicates that it timeouts when a response arrives or an error occurs.
RETURN TYPE:
NoneType
RETURNS:
None
EXCEPTIONS:
MilvusException
- Raised if any error occurs during this operation.
Examples
from pymilvus import MilvusClient
client = MilvusClient(uri, token) # db = "default"
client.create_database(
db_name="my_db",
properties={
"database.replica.number": 3
}
)