MongoDB C100DBA MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+) Exam Practice Test
MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+) Questions and Answers
Which of the following does MongoDB use to provide High Scalability?
Given a replica set with five data-bearing members, suppose the primary goes down with operations in its oplog that have been copied from the primary to only one secondary. Assuming no other problems occur, which of the following describes what is most likely to happen?
Which of the following is incorrect statement about find and findOne operations in MongoDB?
Which are the ONLY ways to project portions of an array?
A MongoDB database administrator needs to improve the performance of the following query:
db.employees.find(
{},
{ name: 1, department: 0, salary: 1 }
).sort({ department: 1, salary: -1 });
What index should the administrator use to achieve this goal?
Consider a collection posts which has fields: Jd, post_text, post_author, post_timestamp, post_tags etc. Which of the following query retrieves ONLY the key named post_text from the first document retrieved?
Which node in a replica set does accept write operation?
A MongoDB administrator is currently managing a single node MongoDB Enterprise deployment. The administrator is considering setting up replication with a secondary node and a delayed member.
Which TWO reasons align to the objectives of the administrator?
Which of the following needs to be performed prior to initiate backup on a sharded cluster?
What does the following $slice query return using the following command? db.posts.find( {}, { comments: { $slice: [ -10, 5 ] } } )
Consider a clothing collection that contains these documents:
{ " _id " : 1, " item " : " sweater " , " sizes " : [ " XS " , " S " ] }
{ " _id " : 2, " item " : " t-shirt " , " sizes " : [ " S " , " M " , " XL " ] }
{ " _id " : 3, " item " : " vest " , " sizes " : [ " M " , " L " , " XL " , " XXL " ] }
What does the following query return?
db.clothing.find({ " sizes " : " M " })
What tool do you use to see if you have a problem in the consumption of disk I / 0?
Which TWO commands can be used to remove the role, " specialRole " from " user1 " ?
A MongoDB administrator is managing a database for a hospital system.
The patients collection contains:
- Carlos Martinez, diagnosis Hypertension, room 203
- Maria Lopez, diagnosis Hypertension, room 207
- Juan Perez, diagnosis Arrhythmia, room 207
The administrator runs:
db.patients.updateMany(
{ diagnosis: " Hypertension " },
{ $set: { room: 207 } }
)
What output should the administrator expect?
Which of the following is a valid Replica Set configuration if you want:
1-Have 3 copies of everything
2- That RS3 is never primary
2- That RSI and RS2 can be primary?
You had to see the different configurations, RS3 could be hidden or priority 0 (But not a referee because we need
3 replicas), while RSI and RS2 could NOT have priority 0 or be hidden or anything like that
In a 4-member RS RSO , RSI, RS2 and RS3 + Referee, RSO (primary) falls after some write operations that have
replicated RSI and RS2 (but NOT RS3), who can get up as the new primary?
The configuration comes and in it we see that RS2 has a hidden: true (or a priority: 0, (I don ' t remember)
The difference between $push and $addToSet is:
Given a collection posts as shown below having a document array comments, which of the following command will create an index on the comment author descending?
Which of the following node is used during election in a replication cluster?
What is the equivalent command in MongoDB for the following SQL query?
SELECT * FROM posts WHERE author like " %john% "
What command is used to grant a role " customRole1 " to an existing user called " user1 " ?
In a sharded replicas set environment with multiple mongos servers, which of the following would decide the mongos failover?
A collection and a document in MongoDB is equivalent to which of the SQL concepts respectively?
Which is the default mode in which the explain() command runs?
Which of the documents below will be retrieved by the following query? Assume the documents are stored in a collection called " sample " . Check all that apply.
db.sample.find( { " $or " : [ { " a " : { " $in " : [ 3, 10] > }, { " b " : { " $lt " : 2 > > ] > )
You are in a sharded cluster. What will you do prior to initiating backup in sharded cluster?
Which of the following does MongoDB use to provide High Availability and fault tolerance?
' mongoimport ' command is used for
A MongoDB administrator needs to create a new role with only the read privileges for the products database.
What command should the administrator use?
Which of the following commands will return all the posts with number of likes greater than 100 and less than 200, both inclusive?
Mongodb does provide high availability via which option?
What command is used to check the value that " logLevel " is set to?
Which of the following command inside aggregate command is used in MongoDB aggregation to filter the documents to pass only the documents that match the specified condition(s) to the next pipeline stage.
In a replica set, a_________number of members ensures that the replica set is always able to select a primary.
Consider an inventory collection that contains these documents:
{ " _id " : 1, " product " : " x-small box " , " colors " : [ " brown " , " black " , " white " ], " qty " : 50 }
{ " _id " : 2, " product " : " small box " , " colors " : [ " brown " , " white " ], " qty " : 60 }
{ " _id " : 3, " product " : " medium box " , " colors " : [ " black " , " grey " , " white " ], " qty " : 45 }
{ " _id " : 4, " product " : " large box " , " colors " : [ " grey " ], " qty " : 50 }
{ " _id " : 5, " product " : " x-large box " , " colors " : [ " grey " , " white " ], " qty " : 10 }
What result set does the following query return?
db.inventory.find({
$or: [
{ " product " : " x-small box " },
{
$and: [
{ " qty " : { $ne: 50 } },
{ " colors " : { $nin: [ " brown " ] } }
]
}
]
})
Consider an orders collection that contains these documents:
{ _id: 1, product: " X-pad " , quantity: 950 }
{ _id: 2, product: " X-pad-pro " , quantity: 1000 }
{ _id: 3, product: " X-phone " , quantity: 850 }
{ _id: 4, product: " X-phone-pro " , quantity: 1350 }
Commands A and B are run at the same time. Assume that no other operations are running.
In order to ensure that you can maintain high availability in the face of server failure, you should implement which of the following?
Using an arbiter allows one to easily ensure an odd number of voters in replica sets. Why is this important?
What are TWO functions of sharding?
Which of the following aggregation commands in MongoDB does not support sharded collections?
Which of the following aggregate commands in MongoDB uses a pipeline approach with the goals of improving the aggregation performance?
If you have created a compound index on (A,B, C) which of the following access pattern will not be able to utilize the index?
The following aggregation option is used to specify the specific fields that needs to be passed to the next stage of the aggregation pipeline:
A database administrator notices that operations on the qa database are not completing, and have been in progress for longer than expected.
What command can the administrator run to see information on in-progress operations on the qa database?
What is the output of the following program?
Which features of relational database management systems were deliberately omitted in MongoDB and help us to obtain horizontal scalability? Check all that apply.
Which of the following is supported by MongoDB?
What " stage " indicates that no indexes were available for a query pattern?
Consider the following document:
> db.c.find()
{ " _id " : 12, b : [ 3, 5, 7, 2, 1, -4, 3, 12 ] }
Which of the following queries on the " c " collection will return only the first five elements of the array in the " b "
field? E.g.,
Document you want returned by your query:
{ " _id " : 12, " b " : [ 3, 5, 7, 2, 1 ] >
You are comparing values of different BSON types in mongodb. You want to compare from lowest to highest. Which comparison order is used?
Which of the following commands finds all the documents in the posts collection with post timestamp field as null?
Addding the index {a:l} can potentially decrease the speed of which of the following operations? Check all that apply.