Home / Companies / MongoDB / Blog / Post Details
Content Deep Dive

Quick Start: C# and MongoDB - Delete operations

Blog post from MongoDB

Post Details
Company
Date Published
Author
Ken W. Alger
Word Count
751
Language
English
Hacker News Points
-
Summary

This post covers the last CRUD operation, Delete, in a series on creating, reading, updating, and deleting data using C# and MongoDB. It explains how to create filters for documents to be deleted, using methods such as `DeleteOne()` and `DeleteMany()`, and provides examples of how to delete single or multiple records based on specific conditions, including filtering by score in a collection of student grades. The post concludes that while `DeleteOne()` can be used for efficiency with single records, `DeleteMany()` is more suitable for deleting multiple records with the same filter condition.