This topic describes how to drop a collection and the data within.
Dropping a collection irreversibly deletes all data within it.
When interacting with Milvus using Python code, you have the flexibility to choose between PyMilvus and MilvusClient (new). For more information, refer to Python SDK .
from pymilvus import utility
utility.drop_collection ("book" )
await milvusClient.dropCollection ({ collection_name : "book" });
err = milvusClient.DropCollection (
context.Background (),
"book" ,
)
if err != nil {
log.Fatal ("fail to drop collection:" , err.Error ())
}
milvusClient.dropCollection (
DropCollectionParam .newBuilder ()
.withCollectionName ("book" )
.build ()
);
delete collection -c book
curl -X 'DELETE' \
'${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections/drop' \
-H 'Authorization: Bearer ${TOKEN}' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"collection_name": "book"
}'
Output:
{
"code" : 200 ,
"data" : {}
}
Parameter
Description
collection_name
Name of the collection to drop.
Parameter
Description
collection_name
Name of the collection to drop.
Parameter
Description
ctx
Context to control API invocation process.
CollectionName
Name of the collection to drop.
Parameter
Description
CollectionName
Name of the collection to drop.
Option
Description
-c
Name of the collection to drop.
Parameter
Description
collectionName
Name of the collection to drop.
Learn more basic operations of Milvus: