LOGBOOK

HELP

Quiz Entry - updated: 2026.06.20

How do you delete documents from MongoDB?

Call deleteMany() with a query object to remove every matching document from the collection.

await birthdays.deleteMany({
  name: { $eq: 'Anna' }
});
  • Query syntax is the same as find
  • deleteMany removes ALL matching documents
  • Use deleteOne to remove only the first match
  • Pass empty object {} to delete all documents (use with caution!)

From Quiz: WEBT / Database Connections | Updated: Jun 20, 2026