Bulk.find.delete()¶
On this page
Definition¶
-
Bulk.find.
delete
()¶ Adds a multiple document delete operation to a bulk operations list. Use the
Bulk.find()
method to specify the condition that determines which documents to remove.Bulk.find.delete()
deletes all matching documents. To remove the first matching document, seeBulk.find.deleteOne()
.
Example¶
Create the music
collection:
The following example:
- Initializes a
Bulk()
operations builder. - Searches for the genre
pop
. - Deletes
pop
music from the collection.
To delete only the first matching document, use
Bulk.find.deleteOne()
instead.