Courseiva
CRUD Operations →mediumMultiple Choice

C100DBA CRUD Operations Practice Question

A developer needs to retrieve a subset of fields from a collection. Which TWO methods achieve this using projection?

⚠ Common exam trap

Candidates often choose incorrect method names or assume projection works as a standalone command rather than a secondary argument passed to standard query methods.

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.collection.find(query, projection)

Projection allows developers to minimize network bandwidth and memory usage by returning only necessary fields from documents. Both find() and findOne() support a second argument that defines the projection document. This is a fundamental optimization technique in MongoDB to prevent the 'select *' anti-pattern, ensuring that large fields like binary data or embedded arrays are not fetched when they are not required by the application layer.

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.collection.find(query, projection)

    Why this is correct

    The find method accepts a second argument for projection. This defines which fields to include or exclude from the returned cursor. It is the standard way to retrieve a subset of fields from multiple documents in a collection while maintaining high performance for large datasets.

  • ✓

    db.collection.findOne(query, projection)

    Why this is correct

    Similar to find, findOne accepts a projection document as its second parameter. This returns the first matching document containing only the specified fields, which is efficient for fetching single records when only specific attributes are needed by the application logic during a lookup operation.

  • ✗

    db.collection.aggregate(pipeline, projection)

    Why it's wrong here

    The aggregate method does not accept a projection document as a second argument. Projections within an aggregation framework must be explicitly included as a $project stage within the pipeline array. This distinction is vital for developers transitioning from simple query patterns to complex data processing workflows.

  • ✗

    db.collection.findAndModify(query, projection)

    Why it's wrong here

    This method is used to modify and return a single document, not to perform simple data retrieval with projections. The signature expects 'update' and 'fields' parameters, but using it as a standard find operation is incorrect and inefficient for read-only query tasks in production applications.

  • ✗

    db.collection.update(query, projection)

    Why it's wrong here

    The update method does not support projection syntax. Attempting to pass a projection document here will cause a driver error or be misinterpreted by the server as an invalid update modifier. This is a critical error to avoid when writing data access layer code in MongoDB.

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.