C100DBA practice questions, page 4 of 6, with answer review and explanations.
Question 16
What connection option names in the URI for specifying minimum and maximum number of connections may exist in a connection pool?
minConnections and maxConnections
minConnSize and maxConnSize
minPoolSize and maxPoolSize
minConnPoolSize and maxConnPoolSize
Question 17
Given a collection called coll that contains a single document:{_id:1,a:1}An update statement -db.coll.updateOne({a:1},{$set:{“b.a”:1}})is successfully completed.What is the output of the command after the update statement? db.coll.findOne()
{ _id:1, a:1, b:{a:1}}
{ _id:1, a:1, “b.a”:1}
{ _id:1, a:1}
{ _id:1, a:1, b:“a:1”}
Question 18
Given the following sample documents in the students collection:{ _id: 0, name: “E.M.”, class: “KL” },{ _id: 1, name: “M.T.”, class: “1H” },{ _id: 2, name: “S.F.”, class: “2J” }What command is used to return only the names of all the students?
db.students.find( { name: 1 } )
db.students.find( {}, { name: 1 } )
db.students.find( { name: 1, _id : 0 } )
db.students.find( {}, { name: 1, _id : 0 } )
Question 19
Given the following sample documents in the products collection:{ “name” : “XPhone”, “ram” : 4, “cpu” : 2, “storage” : [ 64, 128, 256 ] },{ “name” : “XPad”, “ram” : 16, “cpu” : 2, “storage” : [ 128, 256, 512 ] },{ “name” : “GTablet”, “ram” : 12, “cpu” : 4, “storage” : [ 16, 64, 128 ] },{ “name” : “GPad”, “ram” : 8, “cpu” : 4, “storage” : [ 128, 256, 1024 ] },{ “name” : “GPhone”, “ram” : 4, “cpu” : 2, “storage” : [ 128, 256, 512 ] }Given the following query:What is the correct output of the query?
Given the following schema sample in the inventory collection (with 1 million documents):{ “_id” : 1, “item” : “Apple”, “type” : “fruit”, “quantity” : 500 }What operations may become slower if the index {“item”: 1, “quantity”: 1} is created on this collection?