C100DEV CRUD Operations Practice Question
A developer is exploring a 'reviews' collection and wants to retrieve only the 'author' and 'rating' fields from every review document, without the _id field, to reduce the payload sent to the application. Which query accomplishes this?
⚠ Common exam trap
Many candidates confuse the query filter argument with the projection argument, since both are plain documents.
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.reviews.find({}, { author: 1, rating: 1, _id: 0 })
Projection is the second parameter of find, and mixing inclusion values with _id: 0 is the standard way to return a subset of fields without the identifier. Passing fields as the first argument turns them into a filter, and using exclusion values in a projection drops the very fields the developer needs.
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.reviews.find({}, { author: true, rating: true })
Why it's wrong here
This projection includes author and rating but leaves _id in the results, because _id is returned by default unless explicitly excluded. The developer asked for the _id field to be omitted, so this query returns more data than requested even though the field selection is otherwise correct.
- ✗
db.reviews.aggregate([{ $project: { author: 0, rating: 0, _id: 0 } }])
Why it's wrong here
A $project stage with values of 0 is an exclusion projection, so this pipeline removes author and rating while keeping every other field, the reverse of what was requested. It also returns a cursor from aggregate rather than the simple find result the developer expected.
- ✗
db.reviews.find({ author: 1, rating: 1, _id: 0 })
Why it's wrong here
Here the field document is passed as the query filter, not the projection, so MongoDB interprets it as a match condition. It would look for documents whose author equals 1 and rating equals 1, returning almost nothing instead of projecting fields, which is the opposite of the intended behavior.
- ✓
db.reviews.find({}, { author: 1, rating: 1, _id: 0 })
Why this is correct
The second argument of find is the projection document. Setting author and rating to 1 includes only those fields, and _id: 0 explicitly suppresses the default inclusion of _id, producing exactly the reduced payload the developer wants.
About these practice questions
One of 259 original C100DEV practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
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 C100DEV 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 C100DEV exam.