Free Demo Questions

Test Online Free MongoDB C100DEV Exam Questions and Answers

Practice a live sample before buying full access. This page keeps the free C100DEV question set organized by page so visitors and search engines can reach the canonical -questions.html URL directly.

Updated Jan 09, 2023 51 Questions 4 Pages
Page 1 of 4
Next Page
Question 1 Selectable Answer
We have an accounts collection with only one document:
{
_id: 54657,
account_id: 557378,
products: [ 'InvestmentStock', 'Commodity', 'CurrencyService' ]
}
We need to use Aggregation Framework to unwind the products Array to obtain new documents with
only one product per document (see below).
Expected output:
[
{ _id: 54657, account_id: 557378, products: 'InvestmentStock' },
{ _id: 54657, account_id: 557378, products: 'Commodity' },
{ _id: 54657, account_id: 557378, products: 'CurrencyService' }
]
Which pipeline should you use?

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/
Question 2 Selectable Answer
Which of the following commands will delete a collection named restaurants?

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.drop/
Question 3 Selectable Answer
Select all true statements regarding to the role of fields and values in a MongoDB document. (select 2)

Answer:
Explanation:
https://docs.mongodb.com/manual/core/document/
Question 4 Selectable Answer
Which of the following commands will successfully insert exactly two new documents into an empty companies collection?

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.insertMany/
Question 5 Selectable Answer
Which of the following methods executes a database command? (mongo shell)

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/method/db.runCommand/
Question 6 Selectable Answer
You have the following index in a movies collection:
{ "title": 1, "imdb.rating": -1, "imdb.votes": -1, "type": 1 }
Can the following query use the given index for both filtering and sorting?

Answer:
Explanation:
Yes, this query can use the index prefix. The order of the fields in the query predicate does not matter.
Since both "imdb.rating" and "title" are part of an index prefix, this query can use the index for an equality condition.
https://docs.mongodb.com/manual/indexes/
Question 7 Selectable Answer
Suppose you insert the following documents into companies collection:
db.companies.insertMany([
{"_id": 1, "name": "Facebook"},
{"_id": 1, "name": "Twitter"},
{"_id": 2, "name": "Tesla"},
{"_id": 3, "name": "Amazon"}
], {"ordered": false})
Select all true statements about this operation. (select 3)

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.insertMany/
Question 8 Selectable Answer
What does it command do in the mongo shell?

Answer:
Question 9 Selectable Answer
Suppose you have a companies collection in your database. Only the following documents are stored in
this collection:
{
_id: ObjectId("52cdef7c4bab8bd675297da4"),
name: 'Powerset',
category_code: 'search',
founded_year: 2006
},
{
_id: ObjectId("52cdef7c4bab8bd675297da5"),
name: 'Technorati',
category_code: 'advertising',
founded_year: 2002
},
{
_id: ObjectId("52cdef7c4bab8bd675297da7"),
name: 'AddThis',
category_code: 'advertising',
founded_year: 2004
},
{
_id: ObjectId("52cdef7c4bab8bd675297da8"),
name: 'OpenX',
category_code: 'advertising',
founded_year: 2008
},
{
_id: ObjectId("52cdef7c4bab8bd675297daa"),
name: 'Sparter',
category_code: 'games_video',
founded_year: 2007
},
{
_id: ObjectId("52cdef7c4bab8bd675297dac"),
name: 'Veoh',
category_code: 'games_video',
founded_year: 2004
},
{
_id: ObjectId("52cdef7c4bab8bd675297dae"),
name: 'Thoof',
category_code: 'web',
founded_year: 2006
}
What is the default sort order in the result set returned in response to the following query?

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/sortByCount/
Question 10 Selectable Answer
Select all options when you should deploy a MongoDB deployment with security enabled.

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/configuration-options/#security-options
Question 11 Selectable Answer
You have the following config file:
storage:
dbPath: /data/db
systemLog:
destination: file
path: /var/log/mongod.log
net:
bindIp: localhost,192.168.168.62
security:
keyFile: /var/pki/keyfile
processManagement:
fork: true
Select all the directories that MongoDB must have access to

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/configuration-options/
Question 12 Selectable Answer
Which of the following statements are true about the mongo shell? Check all that apply.

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/mongo-shell/
Question 13 Selectable Answer
There is a gamers collection in your database with the following document structure:
{ _id: 1, level: 15, is_active: true },
{ _id: 2, level: 14, is_active: true },
{ _id: 3, level: 7, is_active: false }
How do you increase the value of the level field by 20 for a player with id = 3?

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/operator/update/inc/
Question 14 Selectable Answer
Let's consider a replica set of 3 nodes that experiences a network outage. Select true statement.

Answer:
Explanation:
https://docs.mongodb.com/manual/replication/#replication
Question 15 Selectable Answer
Which cursor method should you use to get information about the query plan?

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.explain/
Showing page 1 of 4
Next Page