Skip to main content

drop_database()

Addedv2.5.x

This operation drops the specified database.

📘Notes

This method applies only to dedicated serving clusters and on-demand compute.

  • For a database in dedicated serving clusters, please create MilvusClient with the cluster endpoint.

  • Free & Serverless

https://{cluster-id}.serverless.{region}.vectordb.zillizcloud.com

  • Dedicated

https://{cluster-id}.{region}.vectordb.zillizcloud.com:19530

  • For a database for on-demand compute, create MilvusClient with the project endpoints.

https://{project-id}.{region}.api.zillizcloud.com

Request Syntax

drop_database(
db_name: str,
timeout: Optional[float] = None,
**kwargs,
)

PARAMETERS:

  • db_name (string) -

    [REQUIRED]

    Name of the database to drop.

  • 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.drop_database("my_db")