Test Online Free MongoDB C100DEV Exam Questions and Answers

The questions for C100DEV were last updated On Jan.09 2023

Get C100DEV Full Access
 / 4

Question No : 1
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 No : 2
Which of the following commands will delete a collection named restaurants?

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.drop/

Question No : 3
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 No : 4
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 No : 5
Which of the following methods executes a database command? (mongo shell)

Answer:
Explanation:
https://docs.mongodb.com/manual/reference/method/db.runCommand/

Question No : 6
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 No : 7
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 No : 8
What does it command do in the mongo shell?

Answer:

Question No : 9
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 No : 10
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

 / 4
  TOP 50 Exam Questions
Exam