Docs Home → Develop Applications → MongoDB Drivers → C#/.NET
Delete Many Documents
You can delete more than one document using the DeleteMany()
synchronous
method or the DeleteManyAsync()
asynchronous method on a collection object.
Example
The following code deletes all documents in the restaurants
collection whose
borough
field value equals the word "Brooklyn".
Select the Asynchronous or Synchronous tab to see the corresponding code.
Expected Result
Running either of the preceding full examples prints the following results:
Deleting documents... Deleted documents: 6086 Resetting sample data...done.
Additional Information
To learn more about deleting documents, see the Delete Documents guide.
To learn more about using builders, see Operations with Builders.