MongoDB C100DBA - MongoDB Associate Database Administrator Exam
Page: 3 / 31
Total 152 questions
Question #11 (Topic: Exam A)
What is an example of a MongoDB BSON type?
A. Class
B. Vector
C. Object
D. Map
Answer: C
Question #12 (Topic: Exam A)
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.)
{
_id:1,
a:2,
b:[1,2,3]
}
Which two indexes will improve the performance of db.collection.find({b:2})? (Choose two.)
A. {b:1}
B. {b:1,a:1}
C. {a:1,b:1}
D. {a:1}
Answer: AB
Question #13 (Topic: Exam A)
Assuming correct imports, properly instantiated MongoClient called client, and given the following Java code:
MongoCollection<Document> 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?
MongoCollection<Document> 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?
A. collection.updateSingle(filter, update);
B. collection.updateOne(update, filter);
C. collection.updateSingle(update, filter);
D. collection.updateOne(filter, update);
Answer: D
Question #14 (Topic: Exam A)
Given the following sample documents in products collection:
{ “name” : “XPhone”, “price” : 799, “color : [ “white”, “black” ], “storage” : [ 64, 128, 256 ]},
{ “name” : “XPad”, “price” : 899, “color : [ “white”, “black”, “purple” ], “storage” : [ 128, 256, 512 ]},
{ “name” : “GTablet”, “price” : 899, “color : [ “blue” ], “storage” : [ 16, 64, 128, 1024 ]},
{ “name” : “GPad”, “price” : 699, “color : [ “white”, “orange”, “gold”, “gray” ], “storage” : [ 128, 256, 1024 ]},
{ “name” : “GPhone”, “price” : 599, “color : [ “white”, “orange”, “gold”, “gray” ], “storage” : [ 128, 256, 512 ]}
Given the following query:

What is the correct output of the query?
{ “name” : “XPhone”, “price” : 799, “color : [ “white”, “black” ], “storage” : [ 64, 128, 256 ]},
{ “name” : “XPad”, “price” : 899, “color : [ “white”, “black”, “purple” ], “storage” : [ 128, 256, 512 ]},
{ “name” : “GTablet”, “price” : 899, “color : [ “blue” ], “storage” : [ 16, 64, 128, 1024 ]},
{ “name” : “GPad”, “price” : 699, “color : [ “white”, “orange”, “gold”, “gray” ], “storage” : [ 128, 256, 1024 ]},
{ “name” : “GPhone”, “price” : 599, “color : [ “white”, “orange”, “gold”, “gray” ], “storage” : [ 128, 256, 512 ]}
Given the following query:

What is the correct output of the query?
A. { “name” : “XPad”, “price” : 899, “color : [ “white”, “black”, “purple” ], “storage” : [ 128, 256, 512 ]}
{ “name” : “GTablet”, “price” : 899, “color : [ “blue” ], “storage” : [ 16, 64, 128, 1024 ]} B. { “name” : “XPhone”, “price” : 799, “color : [ “white”, “black” ], “storage” : [ 64, 128, 256 ]}
{ “name” : “GPad”, “price” : 699, “color : [ “white”, “orange”, “gold”, “gray” ], “storage” : [ 128, 256, 1024 ]} C. { “name” : “GPhone”, “price” : 599, “color : [ “white”, “orange”, “gold”, “gray” ], “storage” : [ 128, 256, 512 ]} D. { “name” : “GTablet”, “price” : 899, “color : [ “blue” ], “storage” : [ 16, 64, 128, 1024 ]}
{ “name” : “GTablet”, “price” : 899, “color : [ “blue” ], “storage” : [ 16, 64, 128, 1024 ]} B. { “name” : “XPhone”, “price” : 799, “color : [ “white”, “black” ], “storage” : [ 64, 128, 256 ]}
{ “name” : “GPad”, “price” : 699, “color : [ “white”, “orange”, “gold”, “gray” ], “storage” : [ 128, 256, 1024 ]} C. { “name” : “GPhone”, “price” : 599, “color : [ “white”, “orange”, “gold”, “gray” ], “storage” : [ 128, 256, 512 ]} D. { “name” : “GTablet”, “price” : 899, “color : [ “blue” ], “storage” : [ 16, 64, 128, 1024 ]}
Answer: B
Question #15 (Topic: Exam A)
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.)
{
_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.)
A. {“a.b”:1,”a,c”:1}
B. {a:1}
C. {”a,c”:1,“a.b”:1}
D. {“a.b”:1}
Answer: AD