MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+) Questions and Answers
What is the correct read preference option to direct all read operations to the secondary?
The difference between $push and $addToSet is:
Which command is used to determine storage capacity of specific database?
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?
Which of the following is correct about MongoDB?
What " stage " indicates that no indexes were available for a query pattern?
Which TWO mongosh commands can be used to shutdown the mongod daemon?
JSON stands for
MongoDB is
Which are the ONLY ways to project portions of an array?
What is the first task that a secondary would perform on being prompted by another secondary for an election?
Dada una coleccion, cuales devuelve con la siguiente query db.coleccion.find({nombre: " ruben " ,apellido: " gomez " },{nombre:l,apellido:l,aficion:l});
What is the output of following two commands in MongoDB: db. posts. insert({n_id " :l}) db.posts.insert({ " _id " :l})
Consider the following posts document:
Which of the following queries will return the documents but with only the first two tags in the tags array?
What does the totalCreated field mean in the output of the db.serverStatus().connections command?
> db.serverStatus().connections
{
" current " : 4,
" available " : 51196,
" totalCreated " : 5,
" active " : 2,
" threaded " : 4,
" exhaustIsMaster " : 1,
" exhaustHello " : 0,
" awaitingTopologyChanges " : 1
}
You have a replicated cluster with 1 primary, 3 secondary, 1 arbiter. One of the secondary is hidden. What is the replication factor of this replicated cluster?
Which of the following node is used during election in a replication cluster?
Given the following MongoDB documents in the cars collection:
{
" carid " : 1,
" make " : " Toyota " ,
" model " : " Celica " ,
" mileage " : 143121,
" color " : " Red " ,
" year " : 2003,
" features " : [ " Leather Interior " , " 2WD " , " CD Player " ]
},
{
" carid " : 2,
" make " : " Honda " ,
" model " : " Civic " ,
" mileage " : 12000,
" color " : " White " ,
" year " : 2020,
" features " : [ " Cloth Interior " , " Sun Roof " , " XM Radio " ]
},
{
" carid " : 3,
" make " : " Tesla " ,
" model " : " Model S " ,
" mileage " : 5,
" color " : " Silver " ,
" year " : 2022,
" features " : [ " Leather Interior " , " Sun Roof " , " Auto Pilot " ]
}
What documents are returned from running the following $in query?
db.cars.find({ " features " : { $in: [ " Leather Interior " , " 2WD " , " Auto Pilot " ]}})
Consider that you have a collection called population which has fields state and city. Which of the following query will calculate the population grouped by state and city?
In a replica set, which member is responsible for maintaining copies of the primary ' s data?
What does the following aggregate query perform?
What command is used to check the value that " logLevel " is set to?
Consider a contacts collection that contains these documents:
{ " _id " : 1, " name " : " Poppy " , " birthday " : " 03-09-1984 " }
{ " _id " : 2, " name " : " Ashley " , " birthday " : " 08-12-1990 " }
{ " _id " : 3, " name " : " Cleo " , " birthday " : " 11-02-1976 " }
What query returns the document where the field name is " Poppy " ?
Addding the index {a:l} can potentially decrease the speed of which of the following operations? Check all that apply.
Which of the following needs to be performed prior to initiate backup on a sharded cluster?
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 is supported by MongoDB?
What read preference should your application use if you want to read from the primary under normal circumstances but allow reads from secondaries when a primary is unavailable?
What command is used to grant a role " customRole1 " to an existing user called " user1 " ?
You perform the following operation in the shell: db.foo.insert( { } ); What gets inserted?
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?
As per the aggregation pipeline optimization concepts, if you have a $sort followed by a $match:
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?
We can insert multiple documents in bulk using which of the following operations:
What tool should be used to access and administer a MongoDB cluster?
Which type of indexes does MongoDB support?
What is the on-premise solution having functionality equivalent to cloud manager?
What is one purpose of a hidden index?
In a replica set with a primary and two secondaries, what should the write concern be set to so only a single node is required to acknowledge a write operation before it is deemed successful?
What operation updates the value of the unitsInStock field to 25 for a document with a " laptop " product, and inserts a new document if it does not exist?
What command should a MongoDB database administrator use to find the disk utilization of the order collection?
Below is a sample document of " orders " collection
What tool do you use to see if you have a problem in the consumption of disk I / 0?
In mongodb how do you update a document partially?
What is the output of the following program?
What does the following query do when performed on the posts collection? db.posts.update({_id:l},{Title:This is post with ID 1 " })
In a replica set, a_________number of members ensures that the replica set is always able to select a primary.
Which of the following is incorrect statement about find and findOne operations in MongoDB?
In a collection that contains 100 post documents, what does the following command do? db. posts. find().skip(5).limit(5)
In a sharded replica set environment, the w Option provides ability for write concern and j Option provides ability for the data to be written on disk journal. Consider that we have a seven member replica set and we want to assure that the writes are committed to journal. What should be the value of j?
In a sharded replicas set environment with multiple mongos servers, which of the following would decide the mongos failover?