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