C100DBA Sharding Practice Question
An application issues a find query against a sharded collection without including the shard key in the query filter. How does the mongos query router handle this operation?
⚠ Common exam trap
Candidates incorrectly assume that queries missing the shard key will automatically fail or target only the primary shard, missing that mongos must perform an inefficient scatter-gather operation across all shards.
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
✓
It performs a scatter-gather query by sending the request to all shards in the cluster, merging the results before returning them to the client.
When a query lacks the shard key, the mongos query router cannot determine which specific shard holds the target document. Consequently, it executes a scatter-gather query, forwarding the request to every shard in the cluster, collecting the responses, and merging them before returning the result to the client.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
It performs a scatter-gather query by sending the request to all shards in the cluster, merging the results before returning them to the client.
Why this is correct
It performs a scatter-gather query by sending the request to all shards in the cluster, merging the results before returning them to the client. Without the shard key in the filter, mongos lacks routing clues and must query every shard, increasing network overhead and latency.
- ✗
It rejects the query immediately with an invalid operation exception to protect cluster performance from unindexed scans.
Why it's wrong here
mongos does not reject such queries; it broadcasts them to every shard and merges the results, since no shard key means no targeted routing. Rejection is tempting because scatter-gather is costly, but that behaviour applies only to operations like sharded updates requiring the key.
- ✗
It routes the query exclusively to the primary shard of the database, bypassing all other shards in the infrastructure.
Why it's wrong here
It routes the query exclusively to the primary shard of the database, bypassing all other shards in the infrastructure. Sharded collection data is distributed across multiple shards, so routing queries exclusively to the primary shard would miss documents stored on other shards.
- ✗
It broadcasts the query only to the config server primary, which evaluates the predicate against cached metadata documents.
Why it's wrong here
It broadcasts the query only to the config server primary, which evaluates the predicate against cached metadata documents. Config servers store metadata only and do not contain user collection documents or handle application read queries.
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 →
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.