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?
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?
A MongoDB collection named users contains sample documents with fields including name, age, address, description, city, and occupation.
The administrator uses the following query to perform a collection scan:
db.users.find({ city: " New York " , occupation: " Software Engineer " })
What compound index will improve the performance of the query the MOST?
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?
Which TWO commands can be used to check for all active operations on the current node?
Below is a sample document in a given collection test.
{ a : 5, b : 3, c: 2, d : 1 >
Given a compound index { a: 1, b:l, c:l, d:l}, Which of the below query will not use in-memory sorting? Select
all valid.
In a sharded cluster, from which node does one stop the balancer process before initiating backup?
What is the first task that a secondary would perform on being prompted by another secondary for an election?
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?
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?
Which of the following statements are true about the $match pipeline operator? Check all that apply.
What does the following query do when performed on the posts collection? db.posts.update({_id:l},{Title:This is post with ID 1 " })
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?
Which of the following does MongoDB use to provide High Availability and fault tolerance?
You have the following index on the toys collection:
{
" manufacturer " : 1,
" name " : 1,
" date " : -1
}
Which of the following is able to use the index for the query? Check all that apply.
Which TWO methods should an administrator use to create a backup of a MongoDB replica set?
We can insert multiple documents in bulk using which of the following operations:
Which command can be used to rebuild the indexes on a collection in MongoDB?
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?
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 " ] } }
]
}
]
})
Which of the following commands will return all the posts with number of likes greater than 100 and less than 200, both inclusive?
Consider the following example document:
{
" _id " : Objectld( " 5360c0a0a655a60674680bbe " ),
" user "
" login " : " irOn "
" description " : " Made of steel "
" date " : ISODate( " 2014-04-30T09:16:45.836Z " ),
}
>
and index creation command:
db.users.createlndex( { " user.login " : 1, " user.date " : -1 }, " mylndex " )
When performing the following query:
db.users.find( { " user.login " : /Air.*/ },
{ " user " :1, " _id " :0 > ).sort( { " user.date " :1 > )
which of the following statements correctly describe how MongoDB will handle the query? Check all that apply.
What is the correct read preference option to direct all read operations to the secondary?
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 features of relational database management systems were deliberately omitted in MongoDB and help us to obtain horizontal scalability? Check all that apply.
If the value of totalKeysExamined is 30000 and the value of totalDocsExamined is 0, which of the following option is correct?
Dada una coleccion, cuales devuelve con la siguiente query db.coleccion.find({nombre: " ruben " ,apellido: " gomez " },{nombre:l,apellido:l,aficion:l});
Which of the following are common uses of the mongo shell? Check all that apply
You have designed a web application with mongoDB. You have configured replication. The replica set is in place and function properly. What happens in case of failure?
In a replica set, which member is responsible for maintaining copies of the primary ' s data?
Consider the following documents:
You perform the following query;
How many documents will be updated by the query?
What mongosh command connects to node-1.cluster1.mycompany.local on port 27017?
What is the maximum size of Index Key Limit and Number of Indexes per collection?
Which of the tags in a replica set configuration specify the operations to be read from the node with the least network latency?
What does the following $slice query return using the following command? db.posts.find( {}, { comments: { $slice: [ -10, 5 ] } } )
What feature is one of the differences between using MongoDB and a relational database management system (RDBMS) database?
Which of the following is true of the mechanics of replication in MongoDB? Check all that apply.