C100DBA practice questions, page 3 of 6, with answer review and explanations.
Question 11
What is an example of a MongoDB BSON type?
Class
Vector
Object
Map
Question 12
Given a sample collection called collection where all documents have the following shape:{_id:1,a:2,b:[1,2,3]}Which two indexes will improve the performance of db.collection.find({b:2})? (Choose two.)
{b:1}
{b:1,a:1}
{a:1,b:1}
{a:1}
Question 13
Assuming correct imports, properly instantiated MongoClient called client, and given the following Java code:MongoCollection collection = client.getDatabase(“employees”).getCollection(“records”);Bson filter = eq(“name”, “Samantha Smith”);Bson update = set(“name”, “Sam Smith”);What statement correctly updates a single document in MongoDB?
Given a sample collection called collection, in which all documents have the following shape:{_id:1,a:{b:[1,2,3],c:”example”}}And the following query:db.collection.find({“a.b”:2})Which two indexes will improve the performance of that query? (Choose two.)