🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

milvus-logo
LFAI
Home
  • User Guide
  • Home
  • Docs
  • User Guide

  • Manage Partitions

  • Drop a Partition

Drop Partitions

This topic describes how to drop a partition in a specified collection.

  •   You have to release the partition before you drop it.
  •   Dropping a partition 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 Collection
collection.drop_partition("novel")
await milvusClient.dropPartition({
  collection_name: "book",
  partition_name: "novel",
});
err := milvusClient.DropPartition(
  context.Background(),   // ctx
  "book",                 // CollectionName
  "novel",                // partitionName
)
if err != nil {
  log.Fatal("fail to drop partition:", err.Error())
}
milvusClient.dropPartition(
  DropPartitionParam.newBuilder()
    .withCollectionName("book")
    .withPartitionName("novel")
    .build()
);
delete partition -c book -p novel
curl -X 'DELETE' \
  'http://localhost:9091/api/v1/partition' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "collection_name": "book",
    "partition_name": "novel"
  }'
Parameter Description
partition_name Name of the partition to drop.
Parameter Description
collection_name Name of the collection to drop partition from.
partition_name Name of the partition to drop.
Parameter Description
ctx Context to control API invocation process.
CollectionName Name of the collection to drop a partition in.
partitionName Name of the partition to drop.
Parameter Description
CollectionName Name of the collection to drop a partition in.
PartitionName Name of the partition to drop.

What’s next

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?