C100DBA

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?

  1. minConnections and maxConnections
  2. minConnSize and maxConnSize
  3. minPoolSize and maxPoolSize
  4. 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()

  1. { _id:1, a:1, b:{a:1}}
  2. { _id:1, a:1, “b.a”:1}
  3. { _id:1, a:1}
  4. { _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?

  1. db.students.find( { name: 1 } )
  2. db.students.find( {}, { name: 1 } )
  3. db.students.find( { name: 1, _id : 0 } )
  4. 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?

  1. { “name” : “XPad”, “ram” : 16, “cpu” : 2, “storage” : [ 128, 256, 512 ] }{ “name” : “GTablet”, “ram” : 12, “cpu” : 4, “storage” : [ 16, 64, 128 ] }
  2. { “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 ] }
  3. { “name” : “GTablet”, “ram” : 12, “cpu” : 4, “storage” : [ 16, 64, 128 ] }{ “name” : “GPad”, “ram” : 8, “cpu” : 4, “storage” : [ 128, 256, 1024 ] }
  4. { “name” : “XPad”, “ram” : 16, “cpu” : 2, “storage” : [ 128, 256, 512 ] }{ “name” : “GPhone”, “ram” : 4, “cpu” : 2, “storage” : [ 128, 256, 512 ] }

Question 20

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?

  1. db.inventory.find({“quantity”: {$gte: 250, $lte: 400}})
  2. db.inventory.updateMany({{“type”: “food” }, {$set: {“status” : “BackOrder”}}})
  3. db.inventory.updateMany({{“type”: “fruit” }, {$inc: {“quantity” : 100}}})
  4. db.inventory.find({“item”: “Apple”})