Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

MongoDB C100DBA Exam Questions

Exam Name: MongoDB Certified Database Administrator Exam
Exam Code: C100DBA
Related Certification(s): MongoDB Certifications
Certification Provider: MongoDB
Actual Exam Duration: 90 Minutes
Number of C100DBA practice questions in our database: 172 (updated: Oct. 30, 2026)
Expected C100DBA Exam Topics, as suggested by MongoDB :
  • Topic 1: Philosophy and Features: This topic of the C100DBA exam, assesses MongoDB Database Administrators on their understanding of MongoDB's core characteristics, its differences from RDBMS databases, access and administration methods, and the concept of sharding. Mastery here ensures a strong foundational knowledge of MongoDB philosophy.
  • Topic 2: CRUD: This topic of the MongoDB Certified DBA Associate exam evaluates administrators on creating, reading, updating, and deleting documents. It measures the ability to handle structured document insertion, updates, upserts, deletions, and query operations. Proficiency in CRUD operations is vital for daily MongoDB database management.
  • Topic 3: Indexes: The C100DBA exam tests knowledge of aspiring MongoDB Database Administrators on optimizing query performance through indexing. Administrators must identify appropriate indexes, understand explain plan outputs, and resolve index-related errors. Effective indexing skills enhance MongoDB database efficiency and performance.
  • Topic 4: Server Administration: This topic of the MongoDB Certified DBA Associate exam focuses on essential server management tasks. MongoDB Database Administrators must demonstrate proficiency in starting, stopping, and configuring mongod, using mongosh, and managing replica sets. Competence in server administration is crucial for maintaining MongoDB database operations.
  • Topic 5: Monitoring: This topic examines the ability to monitor database performance and health. MongoDB Database Administrators should identify alerts, use currentOp, monitor active operations, and manage storage effectively. Strong monitoring skills ensure the MongoDB database runs smoothly and efficiently.
  • Topic 6: Security: The topic assesses the ability to secure MongoDB environments. MongoDB Database Administrators attempting the C100DBA exam must understand TLS, authentication, role-based authorization, encryption, and audit logging. Robust security skills protect MongoDB data integrity and ensure compliance with security standards.
  • Topic 7: Replication: It evaluates understanding of replication processes. MongoDB Database Administrators should grasp the roles of primary and secondary nodes, read preferences, rs.status, write concern, and elections. Effective replication management ensures high availability and data redundancy.
  • Topic 8: Backup and Recovery: This topic of the C100DBA exam, tests the ability to create backups of replica sets. MongoDB Database Administrators need to know backup procedures to safeguard data and ensure recovery in case of failures. Proficiency here is critical for maintaining data continuity and integrity.
Disscuss MongoDB C100DBA Topics, Questions or Ask Anything Related
0/2000 characters

Olivia Miller

1 month ago
I passed the C100DBA exam mostly by tightening up CRUD and application administration fundamentals, especially read and write concerns and connection behavior under load. The exam rewards clarity on defaults and tradeoffs, so I made a one page summary of key settings and reviewed it the night before.
upvoted 0 times
...

Paul Green

2 months ago
I just passed the MongoDB DBA Associate exam, and sharding questions were the most time consuming because you have to think about shard keys, chunk distribution, and balancing side effects. Practicing with a small sharded cluster made it easier to spot which choice would reduce scatter gather.
upvoted 0 times
...

Adam Cook

3 months ago
I passed C100DBA, and replication details were trickier than expected because the scenarios mix elections, write concerns, and failure recovery. I reviewed replica set behavior by actually stepping down primaries and watching what changed in the logs.
upvoted 0 times
...

Emily Martin

4 months ago
I managed to pass the MongoDB Certified DBA Associate exam after focusing heavily on indexing and performance, since the questions often hinge on reading query patterns and choosing the right index. Profiling slow queries in a test dataset helped me stop guessing and start reasoning.
upvoted 0 times
...

Application Administration White

5 months ago
You may get driver-level scenarios that ask which connection string or driver option controls retryable writes, transactions, or connection pooling under failure. I passed and recommend studying how readPreference and writeConcern map to driver behavior, session management, and transaction limitations across drivers.
upvoted 0 times
...

Emma Hill

5 months ago
I passed the C100DBA exam, and the hardest part was translating the philosophy questions into real operational decisions, so I leaned on MongoDB docs and ran small labs to confirm my instincts. Doing hands on practice with users, roles, and backups made the server administration section feel straightforward on exam day.
upvoted 0 times
...

Replication White

6 months ago
Several questions presented a multi-node topology and asked what happens during a primary stepdown, how majority write concern affects acknowledged writes, or how oplog entries lead to rollbacks. Study oplog mechanics, election triggers, and the interaction of read preferences and write concerns to reason through those scenarios.
upvoted 0 times

Sharding Smith

5 months ago
I encountered case-style problems about choosing an optimal shard key, diagnosing jumbo chunks, and predicting query routing after chunk migrations. Make sure you understand shard key trade-offs, how the balancer moves chunks, and zone ranges so you can justify choices in those problems.
upvoted 0 times

CRUD Wilson

3 months ago
The exam included practical tasks that required selecting the right update operator or aggregation stage to transform documents, with tricky upsert and arrayFilters behavior to catch you. Review update operators, projection rules, arrayFilters, and the atomicity guarantees for single-document operations to avoid common pitfalls.
upvoted 0 times

Server Administration Clark

2 months ago
Questions focused on real-world troubleshooting such as recovering a failed mongod, interpreting startup log messages, and choosing the correct backup and restore strategy for point-in-time recovery. Get hands-on with WiredTiger settings, config file options, authentication and TLS setup, and practice restores so you can answer those operational scenarios confidently.
upvoted 0 times
...
...
...
...

Betty Johnson

6 months ago
Replica set election priority and priority 0 hidden members tripped me up during the exam because they gave a scenario with multiple failures and I misread priorities. Setting up a three-node replica set and forcing failovers in a lab helped me understand the outcomes.
upvoted 0 times

Thomas King

6 months ago
Honestly I found shard key selection questions tougher since they required thinking about cardinality and write hotspots rather than just indexing theory.
upvoted 0 times

James Baker

6 months ago
Interestingly a performance question looked like an index intersection problem but the correct move was to design a compound index for the query pattern.
upvoted 0 times

Monica Phillips

6 months ago
Quick tip for anyone studying for C100DBA is to memorize the differences between readConcern levels and how majority affects acknowledged writes.
upvoted 0 times

Maria Howard

6 months ago
Surprisingly the exam's replication section tested MongoDB oplog sizing and rollback scenarios, which I hadn't practiced enough.
upvoted 0 times
...
...
...
...

Donald Rodriguez

6 months ago
Definitely double-check how readPreference interacts with primary preferred and tags when a question gives mixed read targets.
upvoted 0 times
...
...

Jonelle

7 months ago
Feeling relieved after passing the MongoDB Certified DBA Associate Exam, thanks to Pass4Success. My advice? Revise effectively by practicing with realistic exam questions.
upvoted 0 times
...

Melina

7 months ago
The hardest was read/write concerns across replica sets and the impact of majority reads. Their practice tests highlighted which prompts require session handling and acknowledged writes.
upvoted 0 times
...

Suzan

7 months ago
Glad I used Pass4Success for exam prep! The MongoDB Certified DBA Associate Exam tests your knowledge of change streams. Understand how to set up and use change streams for real-time data changes and event-driven architectures.
upvoted 0 times
...

Nichelle

8 months ago
I passed the MongoDB exam, and the Pass4Success practice questions were a great help. One question that puzzled me was about the different roles and privileges in server administration and how to assign them correctly, especially in a multi-tenant environment. It was a bit confusing.
upvoted 0 times
...

Jerry

8 months ago
I feared missing key details, but pass4success guided my revision with practical scenarios—trust the process and keep practicing!
upvoted 0 times
...

Thaddeus

8 months ago
Thrilled to announce that I passed the MongoDB Certified DBA Associate Exam! The practice questions from Pass4Success were invaluable. One tricky question was about the different types of indexes and how they affect query performance, especially when using wildcard indexes.
upvoted 0 times
...

Chantay

8 months ago
The initial nerves were real, but Pass4Success broke down complex concepts into manageable steps—stay calm and push through, you will succeed!
upvoted 0 times
...

Micah

9 months ago
Passed the MongoDB Certified DBA Associate Exam today! Huge shoutout to Pass4Success for the excellent study materials.
upvoted 0 times
...

Trevor

9 months ago
I just passed the MongoDB exam, and Pass4Success practice questions were a lifesaver. There was a question on sharding that asked about the implications of using different shard key strategies for collections with varying read and write patterns. I wasn't entirely sure, but I still passed.
upvoted 0 times
...

Reiko

9 months ago
The cloud vs on-prem deployment differences were tough, plus auth and TLS nuances. Pass4Success scenarios walked me through the exact setup steps and common pitfalls.
upvoted 0 times
...

Alyce

9 months ago
Pass4Success practice exams were a game-changer for me. Focusing on the key topics and concepts is crucial - don't try to memorize everything.
upvoted 0 times
...

James

10 months ago
I worried I wouldn't cover everything, yet Pass4Success helped me map the topics and practice until I felt sure—stay determined, success is near!
upvoted 0 times
...

Anabel

10 months ago
Passing the MongoDB Certified DBA Associate Exam was a breeze with Pass4Success practice exams. My top tip? Manage your time wisely and don't get bogged down in any one section.
upvoted 0 times
...

Antione

10 months ago
Indexing options in MongoDB 6+ were confusing, particularly compound indexes and covered queries. The practice exams from pass4success drilled the exact query patterns I’d see on the test.
upvoted 0 times
...

Micaela

10 months ago
MongoDB certification in the bag! Pass4Success made exam prep a breeze. Their questions were right on target.
upvoted 0 times
...

France

11 months ago
My hands were shaking on test day, but Pass4Success provided focused mock exams and helpful tips that made everything click—believe in yourself and go for it!
upvoted 0 times
...

Kris

11 months ago
Nervous about tricky queries and admin tasks, pass4success organized my study plan and boosted my confidence with clear explanations—keep pushing, you can ace it!
upvoted 0 times
...

Helene

11 months ago
Pass4Success, you rock! Your practice tests were key to my success on the MongoDB Certified DBA Associate Exam. Passed!
upvoted 0 times
...

Frederick

11 months ago
Aced the MongoDB Certified DBA Associate Exam! Pass4Success really came through with relevant practice questions. Thanks a bunch!
upvoted 0 times
...

Margart

12 months ago
The exam includes questions on data governance and compliance. Be prepared to discuss how MongoDB can be used to meet regulatory requirements like GDPR. Study features like field-level encryption and auditing.
upvoted 0 times
...

Dorthy

12 months ago
Sharding strategy and balancing got me tangled, especially when routes or chunks moved unexpectedly. Pass4Success practice questions modeled the edge cases and clarified how to monitor chunk migration.
upvoted 0 times
...

Kaitlyn

1 year ago
MongoDB Certified DBA Associate - check! Couldn't have done it without Pass4Success. Their exam prep was invaluable.
upvoted 0 times
...

Nana

1 year ago
I was jittery before the exam, but Pass4Success gave me structured prep and real practice questions that built my confidence—you've got this, future testers!
upvoted 0 times
...

Sherita

1 year ago
The hardest part for me was understanding replica set elections and write concerns; the tricky scenario questions in the Pass4Success exams helped me map out failure modes and how to verify replication lags in real time.
upvoted 0 times
...

Gilma

1 year ago
I successfully passed the MongoDB Certified DBA Associate Exam, and the Pass4Success practice questions were a big help. One question that caught me off guard was about the different types of backups and their impact on server performance, especially when using incremental backups.
upvoted 0 times
...

Louvenia

1 year ago
Whew, that MongoDB exam was tough! Grateful for Pass4Success - their materials were a lifesaver. Passed with flying colors!
upvoted 0 times
...

Julianna

1 year ago
Just passed the MongoDB Certified DBA Associate Exam! Thanks Pass4Success for the spot-on practice questions. Saved me so much time!
upvoted 0 times
...

Werner

1 year ago
I passed the MongoDB exam, and the practice questions from Pass4Success were really helpful. One question that stumped me was about the different types of indexes and their impact on query performance, especially when using geospatial indexes.
upvoted 0 times
...

Jamal

1 year ago
MongoDB Atlas features are covered in the exam. Expect questions about setting up and managing Atlas clusters, including security features and integration with cloud providers. Study Atlas-specific tools and best practices.
upvoted 0 times
...

Lemuel

1 year ago
Just cleared the MongoDB Certified DBA Associate Exam, thanks to the practice questions from Pass4Success. There was a challenging question on replication that asked about the election process in a replica set and how priorities are determined. I had to think hard about that one.
upvoted 0 times
...

Art

1 year ago
Pass4Success made MongoDB exam prep a breeze. Passed on the first try!
upvoted 0 times
...

Glennis

1 year ago
Capacity planning questions appear on the exam. You may need to estimate hardware requirements for different workloads and growth scenarios. Understand how to calculate storage needs and plan for scaling.
upvoted 0 times
...

Simona

1 year ago
Thanks to Pass4Success, I'm now MongoDB certified. Their prep was quick and effective!
upvoted 0 times
...

Dorthy

1 year ago
The exam tests your understanding of MongoDB's consistency model. Be ready to explain read and write concerns, and how they affect data consistency and durability. Study the implications of different consistency levels.
upvoted 0 times
...

Fernanda

1 year ago
Disaster recovery planning is featured in the exam. You might need to design a disaster recovery strategy for different deployment scenarios. Study concepts like geographic distribution and data center failover.
upvoted 0 times
...

Andree

1 year ago
Conquered the MongoDB exam with Pass4Success. Their questions were spot-on!
upvoted 0 times
...

Ma

2 years ago
Query optimization is crucial. The exam may ask you to analyze and improve slow queries. Practice using indexes, covered queries, and understand how the query optimizer works to choose execution plans.
upvoted 0 times
...

Laura

2 years ago
MongoDB certification achieved! Pass4Success's prep materials were invaluable.
upvoted 0 times
...

Nieves

2 years ago
Shoutout to Pass4Success for helping me ace the MongoDB DBA exam in record time!
upvoted 0 times
...

Mona

2 years ago
Passed the exam! Transaction management in MongoDB is a key topic. Be prepared to explain ACID properties in the context of multi-document transactions and how to implement them effectively.
upvoted 0 times
...

Tawanna

2 years ago
The exam covers data migration strategies. You might need to describe how to migrate data between different MongoDB versions or from other databases to MongoDB. Understand the use of mongoimport and mongoexport tools.
upvoted 0 times
...

Bernadine

2 years ago
Passed the MongoDB exam thanks to Pass4Success. Their questions matched the real thing!
upvoted 0 times
...

Janey

2 years ago
Monitoring and alerts are important topics. Expect questions about setting up monitoring systems and configuring alerts for critical events. Study how to use MongoDB Cloud Manager or Ops Manager for monitoring deployments.
upvoted 0 times
...

Bernardine

2 years ago
Thankful for Pass4Success! Their practice questions really helped me prepare for the MongoDB Certified DBA Associate Exam in a short time. The exam includes scenarios on managing replica set members. Be ready to add or remove members and handle configuration changes.
upvoted 0 times
...

Domonique

2 years ago
MongoDB certified! Pass4Success made last-minute studying a breeze.
upvoted 0 times
...

Lorita

2 years ago
Storage engines are covered in the exam. You might need to compare WiredTiger and in-memory storage engines, explaining their use cases and configuration options. Study compression and cache settings for WiredTiger.
upvoted 0 times
...

Vernell

2 years ago
I passed the MongoDB exam, and the Pass4Success practice questions were a great help. One question that puzzled me was about the different roles and privileges in server administration and how to assign them correctly. It was a bit confusing.
upvoted 0 times
...

Noemi

2 years ago
The exam tests your knowledge of data modeling best practices. Be prepared to choose appropriate document structures for different scenarios and understand the implications of embedding vs. referencing documents.
upvoted 0 times
...

Alison

2 years ago
Grateful for Pass4Success's help in passing the MongoDB DBA exam. Their questions were on point!
upvoted 0 times
...

Nickole

2 years ago
Performance tuning questions are common. You may need to identify bottlenecks in MongoDB operations and suggest improvements. Study how to use mongostat, mongotop, and the database profiler to diagnose performance issues.
upvoted 0 times
...

Laura

2 years ago
Thrilled to announce that I passed the MongoDB Certified DBA Associate Exam! The practice questions from Pass4Success were invaluable. One tricky question was about the different types of indexes and how they affect query performance, especially when using text indexes.
upvoted 0 times
...

Yasuko

2 years ago
MongoDB's aggregation framework is a significant part of the exam. Expect to write and analyze multi-stage aggregation pipelines. Focus on understanding $match, $group, and $project stages, as well as how to optimize aggregation performance.
upvoted 0 times
...

Thurman

2 years ago
Pass4Success nailed it with their MongoDB exam prep. Passed with flying colors!
upvoted 0 times
...

Zana

2 years ago
Backup and recovery scenarios are featured in the exam. You might need to describe the steps for performing point-in-time recovery or explain the differences between full and incremental backups. Review mongodump and mongorestore utilities.
upvoted 0 times
...

Nickolas

2 years ago
I just passed the MongoDB exam, and Pass4Success practice questions were a lifesaver. There was a question on sharding that asked about the implications of using hashed vs. ranged shard keys. I wasn't entirely sure, but I still passed.
upvoted 0 times
...

Latrice

2 years ago
Authentication and authorization are important security topics. Be ready to answer questions about role-based access control (RBAC) and how to set up user privileges. Study the different built-in roles and how to create custom roles.
upvoted 0 times
...

Terrilyn

2 years ago
I successfully passed the MongoDB Certified DBA Associate Exam, and the practice questions from Pass4Success were a big help. One question that caught me off guard was about the different types of backups and their impact on server performance. It was a tough one.
upvoted 0 times
...

Desirae

2 years ago
MongoDB certification in the bag! Couldn't have done it without Pass4Success's relevant questions.
upvoted 0 times
...

Jeffrey

2 years ago
Happy to share that I passed the MongoDB exam! The Pass4Success practice questions were really helpful. There was a question on CRUD operations that asked about the differences between updateOne and updateMany. I wasn't 100% confident, but I still managed to get through.
upvoted 0 times
...

Gianna

2 years ago
The exam covers indexing strategies in depth. You'll likely encounter questions about creating compound indexes and analyzing query performance. Practice using explain() to optimize queries and understand index intersection.
upvoted 0 times
...

Matthew

2 years ago
I passed the MongoDB Certified DBA Associate Exam, thanks in part to the practice questions from Pass4Success. One challenging question was about the oplog size in replication and how it affects the performance and recovery of a replica set. I had to think hard about that one.
upvoted 0 times
...

Freeman

2 years ago
Aced the MongoDB exam! Pass4Success materials were a lifesaver for quick prep.
upvoted 0 times
...

Toi

2 years ago
Sharding is a key topic on the exam. Expect questions about shard key selection and its impact on data distribution. Make sure you understand how to choose effective shard keys for different data models and query patterns.
upvoted 0 times
...

Iesha

2 years ago
Just cleared the MongoDB exam, and I have to say, Pass4Success practice questions were instrumental. There was a tricky question on sharding that asked about the best shard key for a collection with a high write load. I wasn't entirely sure of the answer, but I managed to pass.
upvoted 0 times
...

Jesusita

2 years ago
Just passed the MongoDB Certified DBA Associate Exam! Be prepared for questions on replication. You might need to configure replica sets and understand their behavior during failover scenarios. Study primary-secondary relationships and election processes.
upvoted 0 times
...

Antonio

2 years ago
I recently passed the MongoDB Certified DBA Associate Exam, and the Pass4Success practice questions were a huge help. One question that stumped me was about the different types of indexes and their impact on query performance. Specifically, it asked how a compound index could be used to optimize a query that filters and sorts on multiple fields.
upvoted 0 times
...

Shalon

2 years ago
Just passed the MongoDB Certified DBA Associate Exam! Thanks Pass4Success for the spot-on practice questions.
upvoted 0 times
...

Twanna

2 years ago
Passed the MongoDB DBA Associate Exam with flying colors! Aggregation pipeline questions were challenging. Practice designing multi-stage pipelines and understand when to use $lookup and $graphLookup. Data modeling scenarios were also common – be ready to choose appropriate schema designs for different use cases. Lastly, review MongoDB Cloud offerings and their features. Thanks to Pass4Success for providing relevant practice questions that helped me prepare in a short time!
upvoted 0 times
...

Jenifer

2 years ago
Just passed the MongoDB Certified DBA Associate Exam! Be ready for questions on sharding configuration. You might encounter scenarios where you need to determine the best shard key for a given data distribution. Study the impact of different shard key choices on query performance and data distribution. Thanks to Pass4Success for their spot-on practice questions that helped me prepare efficiently!
upvoted 0 times
...

Esteban

2 years ago
Successfully completed the MongoDB DBA Associate Exam! Performance tuning was a major focus. Expect to analyze and optimize slow queries using explain() output. Brush up on query plans and index usage. Security questions were also prominent. Study authentication methods and role-based access control. Don't forget about backup and recovery strategies – know the differences between various backup methods. Pass4Success's exam materials were invaluable for covering these topics efficiently.
upvoted 0 times
...

Frederick

2 years ago
Just passed the MongoDB Certified DBA Associate Exam! One tricky area was index creation and management. Expect questions on choosing optimal indexes for specific queries. Study B-tree and text indexes thoroughly. The exam also focused heavily on replication concepts. Be prepared to troubleshoot replica set issues and understand failover processes. Sharding was another key topic – know how to design effective shard keys. Thanks to Pass4Success for the spot-on practice questions that helped me prepare quickly!
upvoted 0 times
...

Free MongoDB C100DBA Exam Actual Questions

Note: Premium Questions for C100DBA were last updated On Oct. 30, 2026 (see below)

Question #1

What command set removes node-1.cluster1.mycompany.local:27017 and node-2.cluster1.mycompany.local:27017 from the replica set, then adds node-1.cluster1.mycompany.local:27017 back to the replica set?

Reveal Solution Hide Solution
Correct Answer: C

The supported mongosh helpers for replica-set membership changes are rs.remove() and rs.add(). rs.remove(hostname) removes the member whose host string matches the supplied host:port, while rs.add() adds a new member using either a host string or a member configuration document that includes a host field. Option C uses those documented methods in the required sequence: remove node 1, remove node 2, then add node 1 back. The names rs.removeNode() and rs.addNode() shown in the other options are not standard MongoDB replica-set helper methods. Membership changes must be performed carefully because modifying voting or data-bearing membership can affect majority calculations, elections, and availability. Administrators normally execute membership changes while connected to the current primary, allow configuration propagation, and verify replica-set health afterward with rs.status() or related diagnostics. If a removed data-bearing node is later re-added, it may need to synchronize depending on how far its data has diverged from the current replica-set history. Among the choices, option C is the only valid command sequence.

Study Guide reference/topic:Cluster Reliability and Data Resilience - replica-set membership, rs.remove(), rs.add(), and topology changes.

===========


Question #2

What command lists all indexes for a collection?

Reveal Solution Hide Solution
Correct Answer: D

db.collection.getIndexes() is the mongosh method used to return the definitions of all indexes that currently exist on a collection. The result is an array of index specification documents that can show fields such as the index name, key pattern, index version, uniqueness, partial-filter settings, sparse configuration, collation, and whether the index is hidden. This makes the method useful for index audits, troubleshooting, and confirming the physical indexes available to the query planner. Option A is not a documented method for enumerating collection indexes. Option B resembles the $indexStats aggregation stage, which reports usage statistics for indexes, but db.collection.indexStats() is not the method used to list full index definitions. Option C, findIndexes(), is also not the documented mongosh collection helper. Administrators should distinguish between listing index definitions, examining index usage, and inspecting an individual query's winning plan: getIndexes() addresses the first requirement, $indexStats addresses usage metrics, and explain() addresses query-planner behavior. Therefore option D is the correct command for listing all indexes on the collection.

Study Guide reference/topic:Indexing and Query Optimization - index administration, index metadata, and db.collection.getIndexes().

===========


Question #3

You are comparing values of different BSON types in mongodb. You want to compare from lowest to highest. Which comparison order is used?

Reveal Solution Hide Solution
Correct Answer: A

Question #4

A department store maintains a clothing collection:

{ "_id": 1, "item": "sweater", "sizes": [ "XS", "S", "L" ] }

{ "_id": 2, "item": "t-shirt", "sizes": [ "S", "M", "L" ] }

{ "_id": 3, "item": "vest", "sizes": [ "M", "L", "XL", "XXL" ] }

An employee runs:

db.clothing.find( { "sizes": "M" } )

Which index should improve performance for this query the MOST?

Reveal Solution Hide Solution
Correct Answer: A

The query filters only on the sizes field, so the most direct supporting index is a single-field index on sizes. Because sizes contains arrays, MongoDB automatically treats the resulting index as a multikey index and creates index entries derived from the array elements. That allows the query { sizes: 'M' } to locate matching documents through the index rather than scanning every document in the collection. Option B indexes item, which is not part of the predicate and therefore does not help this query. Option C contains sizes, but _id is the leading key and the query provides no equality restriction on _id; this prevents efficient use of the later key as a standalone prefix for the query. Option D has the same structural problem because item precedes sizes and is not constrained. MongoDB's index-prefix rules make a targeted { sizes: 1 } index the strongest choice here. In a real workload, DBAs should also consider write overhead and whether additional queries can share a compound index before creating redundant indexes. For this single query pattern, option A is optimal.

Study Guide reference/topic:Indexing and Query Optimization - multikey indexes, array fields, index prefixes, and query support.

===========


Question #5

Which are the ONLY ways to project portions of an array?

Reveal Solution Hide Solution
Correct Answer: C


Unlock Premium C100DBA Exam Questions with Advanced Practice Test Features:
  • Select Question Types you want
  • Set your Desired Pass Percentage
  • Allocate Time (Hours : Minutes)
  • Create Multiple Practice tests with Limited Questions
  • Customer Support
Get Full Access Now

Save Cancel