跳到主要内容

drop_collection()

This operation drops a collection.

Request syntax

drop_collection(collection_name: str) -> None

PARAMETERS:

  • collection_name (str) -

    [REQUIRED]

    The name of an existing collection.

Examples

from pymilvus import MilvusClient

# 1. Set up a milvus client
client = MilvusClient(
uri="https://inxx-xxxxxxxxxxxx.api.gcp-us-west1.zillizcloud.com:19530",
token="user:password"
)

# 2. Create a collection
client.create_collection(
collection_name="test_collection",
dimension=5
)

# 3. List collections
res = client.list_collections()

# ['test_collection']

# 4. Drop the collection
client.drop_collection(collection_name="test_collection")

# 5. List collections
res = client.list_collections()

# []