Primary Shard
For the exam, you should know:
- What data the primary shard contains
- What read and write operations occur on the primary shard
- How aggregation queries use the primary shard
Resources:
- Docs:
You are about to take a MongoDB Certification Exam. Our free study guide will be your road map to exam preparation. We give you a summary of the most pertinent information so you can pinpoint the areas where it would be most beneficial to focus your attention. With a good understanding of the subjects covered here, you should be well prepared to pass. Good luck!
MongoDB professional certification exams are delivered entirely online allowing you to conveniently take the exam in the comfort of your home or office while being monitored by an offsite proctor. The proctor will provide step-by-step instructions to ensure a seamless check-in process. After completing authentication, they will continuously monitor both you and your testing environment to ensure the security and integrity of the exam and help you avoid from incurring any unintentional violations.
To complete your exam, you need a Windows or Mac computer with a video camera (webcam), a microphone, and speakers. No Tablets, e.g., iPads and Google Chromebooks, and other operating systems, e.g., Linux, are not supported. You must be able to pivot the camera (possibly by picking up your laptop) so that the proctor can see everything in the room including your desk. Webcam, speakers, and microphone must remain on throughout the exam. Headphones/earbuds are not permitted during the exam. To ensure a smooth examination experience it is extremely important that you have a stable connection. Please perform a system readiness check prior to scheduling your exam and once again closer to your exam appointment date to verify that your system is still.
You are required to be in a private room without interruption during the exam. Please ask others to refrain from coming into the room where you are taking your exam as it may result in an exam violation. It is not permitted to access reference materials during the exam. Please ensure your desk area is clear of any clutter including electronic devices and notepads. Your proctor will ask you to scan your desk and room area prior to the beginning of the exam and periodically throughout the exam if they believe it to be necessary. You may take the exam at any time during the exam session for which you are registered, day or night. Exam sessions run for one week. They typically begin and end at 17:00 UTC on a Tuesday, but be sure to check the about page for your exam (DBA or Developer) for the exact times.
The exam is made up of 60 multiple choice and check-all-that-apply questions. All questions are weighted equally. You will find it of advantage to answer all questions, as there is no penalty for an incorrect answer. There is no advantage in leaving a question unanswered.
You are permitted to use translation software during your exam to translate questions. However, please note that MongoDB University does not support any translation software and cannot vouch for the suitability or accuracy of their translation. By using a translation software you are assuming all risks associated with it.
This section will describe the foundational computing concepts with which you should be familiar. You should consider these to be prerequisites to understanding MongoDB. We do not teach these directly in our curriculum, but some questions on the exam assume knowledge of these concepts. You can find detailed information on these subjects in computer science textbooks or through searching on the Internet via a search engine (e.g. Google, Bing, etc).
It is expected that you will understand broadly what a database is, specifically:
For the exam, you should have a working understanding of the following:
For the exam, you should know:
In the Philosophy and Features section on the exam, we will verify that you understand the following:
The MongoDB Architecture Guide and this video lecture provide a concise overview of these subjects. We expand on this material below.
For the exam you should know:
Resources:
For the exam you should know:
Resource:
For the exam you should know:
Resources:
You should also know how to work with data types in the shell.
For the exam you should know:
Resources:
For the exam you should know:
Resources:
For the exam you should understand:
Resources:
In the CRUD section of the certification exam, we will verify that you:
In this section, we are not testing that you have the MongoDB query language syntax memorized. However, you should be able to distinguish correctly written queries from those that are not. You should also know which query parameters are necessary versus those that are optional and how to use query parameters. We will not expect you to have query operators memorized, but you should be able to recognize the correct operator for a task from a set of choices.
For the exam, you should be able to:
You should be familiar with the _id field and its special properties:
_id is a field required in every MongoDB document. The _id field must have a unique value for the collection it is used in. You can think of the _id field as the document's Primary Key. If you create a new document without an _id field, MongoDB automatically creates the field and assigns a unique BSON ObjectId. If the document contains an _id field, the _id value must be unique within the collection to avoid duplicate key error.
Document creation can occur through the following commands:
Most questions about document creation will involve the db.collection.insert() command. Inserts are typically straightforward.
Upserts can be more complicated. In the example below, assume the foo collection does not already contain a document with a=5 and b<=7.
> db.foo.update( { a : 5, b : { $lte : 7 } }, { $set : { c : 8 } }, { upsert : true } ) WriteResult({ "nMatched" : 0, "nUpserted" : 1, "nModified" : 0, "_id" : ObjectId("55b0200e5ef34083de46367e") }) > db.foo.find() { "_id" : ObjectId("55b0200e5ef34083de46367e"), "a" : 5, "c" : 8 }
In cases such as this, a new document is inserted. In this specific case, the new document contains the value, c : 8, because the upsert instructed that it be set. The query document also contributes fields to the document that gets created. In this case, a : 5 was also be set. The value of b could not be determined from the query, so it will not be set. Finally, an ObjectId was assigned to the _id field.
Finally, you can bulk insert by passing an array to db.collection.insert() or db.collection.bulkWrite(). You should know the difference between ordered and unordered bulk inserts. You should also know the difference between when to use a bulk operation versus when to use insertMany().
Docs:
In MongoDB, you read documents using either the db.collection.find() method, or the db.collection.findAndModify() method. You should be familiar with both commands, but the find() method will receive greater coverage on the exam.
For the exam, you should be able to:
Starting in MongoDB 4.4, as part of making find and findAndModify projection consistent with aggregation’s $project stage,
- The find and findAndModify projection can accept aggregation expressions and aggregation syntax, including the use of literals and aggregation variables. With the use of aggregation expressions and syntax, you can project new fields or project existing fields with new values.
- The find and findAndModify projection can specify embedded fields using the nested form; e.g. { field: { nestedfield: 1 } } as well as dot notation. In earlier versions, you can only use the dot notation.
In MongoDB, reading data is carried out with the following methods:
db.collection.find()
Keep in mind, though findOne() method returns a single document, a find() query will return a cursor:
Videos:
Docs:
There are other collection read methods that will not return cursors, but with which you should be familiar.
There are other methods that can be applied to cursors themselves. These can return a number (e.g., count), or they can modify the result set (i.e., sort, skip, and limit). You may also be expected to know how to manually iterate a cursor. See the MongoDB documentation for a list of cursor methods
You can also project your results in order to limit the fields you get back.
For the exam, you should be able to:
Updates modify existing documents. Updates can occur with a few collection methods, some of which were in the insert section:
For the exam, you should be able to:
In the certification exam, we will verify that you:
The following resources provide a basic introduction to indexes.
MongoDB creates a unique index on the _id field during the creation of a collection. The _id index prevents clients from inserting two documents with the same value for the _id field. You cannot drop this index on the _id field.
-Docs:
In the exam, we will ensure that you:
For the exam, you should know:
For the exam, you should be able to:
Here are some resources to help:
On the exam, you should know:
On the exam, you should know:
A multikey index is an index on an array field. The index will contain one key per array element.
For the exam, you will need to know:
To support efficient queries of geospatial coordinate data, MongoDB provides two special indexes: 2d indexes that use planar geometry when returning results and 2dsphere indexes that use spherical geometry to return results.
Resources:
For the exam, you will need to know:
Resources:
For the exam, you will need to know:
- How to create a hashed index
- How to create a compound hashed index
Resources:
For the exam, you should know:
Resources:
For the exam, you will need to know:
For the exam, you should know:
Reference:
Resources:
For the exam, you should know:
For the exam, you will need to understand:
For the exam, you should know:
Resources:
Indexes generally speed up read performance, but can slow down write performance. Hybrid actions (e.g., with a find and a write) such as update and remove, may depend on the use case (though they usually are faster with indexes).
For the exam, you will want to know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
Starting in MongoDB 3.2, MongoDB provides the option to create partial indexes. Partial indexes offer a superset of the functionality of sparse indexes. If you are using MongoDB 3.2 or later, partial indexes should be preferred over sparse indexes.
For the exam, you should know:
- How to create a partial index
- Behavior of Partial Index
- Comparison with Sparse Index
- Restrictions applied on Partial Index
Resources:
For the exam, you will need to know:
Resources:
For the exam, you will need to know:
Resources:
In the certification exam, we will verify that you:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should understand:
An aggregation pipeline allows you to combine data from multiple documents in a collection and perform expressive filtering, powerful data transformation, statistical utilities and data analysis.
The aggregation framework in MongoDB is based on the idea of UNIX pipelining. A stage accepts a list of documents as input, manipulates the data in some way, and emits output documents, passing them to the next stage.
The Aggregation section of the exam is emphasized much more heavily in Developer exams than in DBA exams, but you should be familiar with the basic concepts and format of aggregation queries even for the DBA exam.
For the exam, you will need to:
Resources:
For the exam, you will need to know:
Resources:
For the exam, you will need to know:
Resources:
For the exam, you will need to know:
Resources:
For the exam, you will need to know:
Resources:
To help you gain familiarity with aggregation, here are some examples to give you an idea about how aggregation works.
For the exam, you will need to know:
Resources:
On the certification exam, we will attempt to verify that you:
Replication is about availability and durability. It is, generally speaking, not for scaling. That would be the purpose of Sharding.
In the exam, you will be expected to know:
Resources:
For the exam, you should be familiar with:
Resources:
For the exam, you will need to know:
Resources:
For the exam, you will need to know:
Resources:
For the exam, you will need to know:
Resources:
For the certification exam, you should be able to:
Resources:
For the certification exam, you will need to be able to:
Resources:
For the certification exam, you will need to:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
On the certification exam, we will verify that you:
Sharding is about scaling. With sharding, you can distribute your data across several replica sets, each of which is a logical "node" in the sharded cluster.
Note that sharding and replication solve different problems. Replication is concerned with data durability and high availability and Sharding is concerned with horizontal scaling of read and write workloads.
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the certification exam, we will verify that you:
While the definitions are somewhat fluid, Application Administration deals with MongoDB's relationship to applications. The features we consider here include: the wire protocol, over-the-wire encryption, and security.
Server administration deals with architecting, maintaining, and debugging a deployment.
For the exam, you should know:
Resources:
For the exam, you should know:
WiredTiger Compression:
- With WiredTiger, MongoDB supports compressionfor all collections and indexes. Compression minimizes storage use at the expense of additional CPU. - WiredTiger Storage Engine - Compression
snappy:
- A compression/decompression library designed to balance efficient computation requirements with reasonable compression rates. snappy is the default compression library for MongoDB's use of WiredTiger. - snappy - WiredTiger Compression documentation
prefix compression:
- Reduces memory and disk consumption by storing any identical index key prefixes only once, per page of memory. - Compression
zlib:
- A data compression library that provides higher compression rates at the cost of more CPU, compared to MongoDB's use of snappy. You can configure wiredTiger to use zlib as its compression library. - zlib
zstd:
- New in version 4.2
- A data compression library that provides higher compression rates and lower CPU usage when compared to zlib.
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
For the exam, you will need to know:
Resources:
For the exam, you should know:
Reference:
Resources:
For the exam, you should know common deployment patterns for:
Resources:
For the exam, you should know:
Resources:
For the exam, you should be able to:
Resources:
For the exam, you will need to know:
Resources:
For the certification exam, will will verify that you understand:
Most of the information tested can be found by running the tools with the --help option.
For the Developer exam, you will need to know:
For the DBA exam, you will need to know:
For the exam, you should know how to import/export data between MongoDB and:
Resources:
For the exam, you should know:
Resources:
For the exam, you should know:
Resources:
Note:
mongodump and mongorestore cannot be part of a backup strategy for 4.2+ sharded clusters that have sharded transactions in progress. - Reference
For the exam, you should know how to use the following tools:
For the exam, you will need to be able to use mongofiles to put data into GridFS.
Resources:
For the exam, we will verify that you know:
The storage engine is the component of the database that is responsible for managing how data is stored, both in memory and on disk. MongoDB supports multiple storage engines, as different engines perform better for specific workloads. Choosing the appropriate storage engine for your use case can significantly impact the performance of your applications. Pluggable storage engines were introduced with MongoDB 3.0.
WiredTiger is the default storage engine starting in MongoDB 3.2. It is well-suited for most workloads and is recommended for new deployments. WiredTiger provides a document-level concurrency model, checkpointing, and compression, among other features.
For the exam, you should know:
here is an example of WiredTiger data directory:
$ ls -la total 360 -rw-r--r-- 1 will staff 95B Sep 16 15:43 storage.bson -rw-r--r-- 1 will staff 16K Sep 16 15:43 sizeStorer.wt -rwxr-xr-x 1 will staff 6B Sep 16 15:43 mongod.lock* drwxr-xr-x 5 will staff 170B Sep 16 15:43 journal/ -rw-r--r-- 1 will staff 16K Sep 16 15:43 index-5-5307542050812875631.wt -rw-r--r-- 1 will staff 16K Sep 16 15:43 index-3-5307542050812875631.wt -rw-r--r-- 1 will staff 16K Sep 16 15:43 index-1-5307542050812875631.wt drwxr-xr-x 4 will staff 136B Sep 16 15:43 diagnostic.data/ -rw-r--r-- 1 will staff 4.0K Sep 16 15:43 collection-6-5307542050812875631.wt -rw-r--r-- 1 will staff 16K Sep 16 15:43 collection-4-5307542050812875631.wt -rw-r--r-- 1 will staff 16K Sep 16 15:43 collection-2-5307542050812875631.wt -rw-r--r-- 1 will staff 16K Sep 16 15:43 collection-0-5307542050812875631.wt -rw-r--r-- 1 will staff 16K Sep 16 15:43 _mdb_catalog.wt -rw-r--r-- 1 will staff 4.0K Sep 16 15:43 WiredTigerLAS.wt -rw-r--r-- 1 will staff 24K Sep 16 15:43 WiredTiger.wt -rw-r--r-- 1 will staff 907B Sep 16 15:43 WiredTiger.turtle -rw-r--r-- 1 will staff 21B Sep 16 15:43 WiredTiger.lock -rw-r--r-- 1 will staff 45B Sep 16 15:43 WiredTiger drwxr-xr-x 4 will staff 136B Sep 16 15:43 ../ drwxr-xr-x 20 will staff 680B Sep 16 15:43 ./
Starting in MongoDB Enterprise version 3.2.6, the in-memory storage engine is part of general availability (GA) in the 64-bit builds. Other than some metadata and diagnostic data, the in-memory storage engine does not maintain any on-disk data, including configuration data, indexes, user credentials, etc. By avoiding disk I/O, the in-memory storage engine allows for more predictable latency of database operations.
人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."