From the course: LLM Foundations: Vector Databases for Caching and Retrieval Augmented Generation (RAG)

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Delete objects and entities

Delete objects and entities

The Milvus SDK also provides options to delete data in Milvus. For deleting a single record, we can use the delete method on the collection and pass an expression for a filter. There are restrictions on what kinds of expressions can be passed. We can pass a list of primary keys with the in feature. On executing this command, we can see metrics on how many records were deleted. To drop a collection, we can use the drop_collection method on the utility object, providing the collection name and a connection ID. Running this code will drop the collection successfully. Similarly, we can drop a database using the drop_database method as shown here. It runs without any errors. Deletion can also be performed using the Attu user interface for any of these objects. We have now explored the features for DLL and DML in Milvus. Now, let's get to implementing a use case for vector databases, namely caching.

Contents