C100DEV practice questions, page 2 of 4, with answer review and explanations.
Question 6
Which two are valid MongoDB BSON types? (Choose two.)
Boolean
Float
Number
Double
Map
Question 7
A products collection needs to update the value of the qty field to 100 for a document with a “card” item value. It should insert a new document if it does not exist.What command should be used?
Given the following documents in the employees collection:{ _id: 0, name: “Y.B.”, department: “Sales” },{ _id: 1, name: “E.H.”, department: “Engineering” },{ _id: 2, name: “C.Y.”, department: “Support” },What mongosh command will find a document with name “E.H.”?
db.employees.query_one( {name: “E.H.”} )
db.employees.find_one( {name: “E.H.”} )
db.employees.queryOne( {name: “E.H.”} )
db.employees.findOne( {name: “E.H.”} )
Question 9
Given the following query:db.restaurants.find({“borough” : “Brooklyn” , “grades.score” : {$gt:5}})No index exists for the restaurant collection.What index definition most improves the performance?
There is a collection of patients for a medical practice.Which two attributes associated with the patient should be embedded into the patient document rather than stored in its own collection and referenced? (Choose two.)