Courseiva
CRUD Operations →easyMultiple Choice

C100DBA CRUD Operations Practice Question

You need to remove a single document from the `users` collection where the `email` field is "alice@example.com". The collection has a unique index on `email`. Which method should you use?

⚠ Common exam trap

The trap here is using deleteMany when only one document should be deleted, or using the deprecated remove() method.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

db.users.deleteOne({ email: "alice@example.com" })

deleteOne is the correct method to remove a single document matching a filter. It is the modern replacement for remove() and is designed for deleting one document. Since the email field has a unique index, there is at most one match, making deleteOne both safe and efficient. deleteMany and drop are inappropriate because they either delete multiple documents or the entire collection.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    db.users.deleteOne({ email: "alice@example.com" })

    Why this is correct

    deleteOne removes the first document that matches the filter. Since email is unique, there is at most one matching document, so deleteOne is appropriate and efficient. It returns a DeleteResult with the number of documents deleted, allowing confirmation that exactly one document was removed.

  • ✗

    db.users.drop({ email: "alice@example.com" })

    Why it's wrong here

    drop() is a method to remove an entire collection, not a document. It does not accept a filter and would delete the whole users collection if called as db.users.drop(). This is catastrophic and completely wrong for removing a single document.

  • ✗

    db.users.deleteMany({ email: "alice@example.com" })

    Why it's wrong here

    deleteMany removes all documents matching the filter. While it would work if email is unique, it is semantically incorrect for deleting a single document. If the unique index were ever dropped or if there were duplicate emails, this could delete multiple documents unexpectedly. deleteOne is more precise for single-document deletion.

  • ✗

    db.users.remove({ email: "alice@example.com" })

    Why it's wrong here

    remove() is deprecated in modern MongoDB versions and its behavior can be ambiguous. It is not recommended for new applications. Although it would delete matching documents, the method has been replaced by deleteOne and deleteMany for clarity and better error handling. Using remove() may also trigger warnings in the shell.

About these practice questions

Courseiva writes every C100DBA question from scratch — 222 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official MongoDB exam blueprint

This C100DBA practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DBA exam.