daniel-was-taken commited on
Commit
d878772
·
1 Parent(s): 9513c18

Add delete collection

Browse files
Files changed (1) hide show
  1. delete_collection.py +13 -0
delete_collection.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pymilvus import MilvusClient
2
+ import os
3
+ # Initialize client
4
+ MILVUS_URI = os.getenv("MILVUS_URI", "http://localhost:19530")
5
+ milvus_client = MilvusClient(uri=MILVUS_URI)
6
+ collection_name = "my_rag_collection"
7
+
8
+ # Delete the collection
9
+ if milvus_client.has_collection(collection_name):
10
+ milvus_client.drop_collection(collection_name=collection_name)
11
+ print(f"Collection '{collection_name}' has been deleted.")
12
+ else:
13
+ print(f"Collection '{collection_name}' does not exist.")