You are on page 1of 15

2023

MongoDB
C100DEV Exam
MongoDB Certified Developer Associate

Questions & Answers


(Demo Version - Limited Content)

Thank you for Downloading C100DEV exam PDF Demo

Get Full File:

https://www.dumpsplanet.com/c100dev-dumps/

www.dumpsplanet.com
Version: 05
Total Question: 260

QUESTION 1

Select all true statements about text search in MongoDB.


A. Text indexes can include any field whose value is a string.
B. MongoDB provides text indexes to support text search queries on string content.
C. To perform text searches on a collection we use $text operator.
D. To perform text search queries, you must have a text index on your collection.
E. Text indexes cannot include any field whose value is an array of string elements.
F. A collection can only have one text search index, but that index can cover multiple fields.

Correct Answer: A,B,C,D,F

Explanation/Reference:

https://docs.mongodb.com/manual/text-search/

QUESTION 2

Select all valid BSON types in MongoDB. (select 4)


A. Boolean
B. Dictionary
C. ObjectId
D. Array
E. String

Correct Answer: A,C,D,E

Explanation/Reference:
www.dumpsplanet.com
https://docs.mongodb.com/manual/reference/bson-types/

QUESTION 3

MongoDB has a flexible data model. Select any invalid MongoDB documents from the following:
A. { _id: ObjectId('61a8b90c6d5ce6a7d8fef95e'), airTemperature: { value: 7.1, quality: '1' },
pressure: { value: 1028.2, quality: '1' }, sections: ['AG1', 'AY1', 'GF1', 'MD1','MW1', 'OA1']}
B. { _id: ObjectId('61a8b90c6d5ce6a7d8fef95e'), airTemperature: { value: 999.9, quality: '9' },
pressure: { value: 9999.9, quality: '9' }, sections: [ 'AG1', 'AY1', 'GF1', 'MW1' ]}
C. { _id: ObjectId('61a8b90c6d5ce6a7d8fef95e') }
D. { _id: ObjectId('61a8b90c6d5ce6a7d8fef95e'), airTemperature: [ value: 7.1, quality: '1' ],
pressure: { value: 1028.2, quality: '1' }, pressure: ['AG1', 'AY1', 'GF1', 'MD1','MW1', 'OA1']}

Correct Answer: D

Explanation/Reference:

https://docs.mongodb.com/manual/core/data-modeling-introduction/

QUESTION 4

You have a company’s collection with the following document structure:


{
_id: ObjectId('52cdef7c4bab8bd675297dac'),
name: 'Veoh',
homepage_url: 'http://www.veoh.com',
category_code: 'games_video',
number_of_employees: null,
founded_year: 2004,
tag_list: 'veoh, video, veohtv, socialvideo, videosharing, crunchbase, inuyasha',
email_address: 'pr@veoh.com',
description: 'Internet TV service'
}
How can you use projection to extract all documents with the following fields: name, homepage_url,
tag_list?
For example:
{
name: 'Veoh',
homepage_url: 'http://www.veoh.com',
tag_list: 'veoh, video, veohtv, socialvideo, videosharing, crunchbase, inuyasha'
}
A. db.companies.find( { _id: 0, name: 1, homepage_url: 1, tag_list: 1 } )
B. db.companies.find( {}, { name: 1, homepage_url: 1, tag_list: 1 } )
C. db.companies.find( {}, { _id: 0, name: 1, homepage_url: 1, tag_list: 1 } )
D. db.companies.find( {}, { _id: 1, name: 1, homepage_url: 1, tag_list: 1 } )

www.dumpsplanet.com
Correct Answer: C

Explanation/Reference:

https://docs.mongodb.com/manual/reference/method/db.collection.find/

QUESTION 5

We have a movies collection with the following document structure:


{
_id: ObjectId("573a1390f29313caabcd6223"),
genres: [ 'Comedy', 'Drama', 'Family' ],
title: 'The Poor Little Rich Girl',
released: ISODate("1917-03-05T00:00:00.000Z"),
year: 1917,
imdb: { rating: 6.9, votes: 884, id: 8443 }
}
We need to use Aggregation Framework to fetch all movies from this collection where 'Drama' is not
in genres list and the minimum 'imdb.votes' is at least 100. Additionally, in the projection stage, we
want to leave only the following fields:
-> title
-> genres
-> imdb.votes
We also want to sort the result set by decreasing imdb votes and limit the number of documents
retuned to 5.
Example output:
[
{
imdb: { votes: 1294646 },
genres: [ 'Action', 'Mystery', 'Sci-Fi' ],
title: 'Inception'
},
{
imdb: { votes: 1109724 },
genres: [ 'Adventure', 'Fantasy' ],
title: 'The Lord of the Rings: The Fellowship of the Ring'
},
{
imdb: { votes: 1081144 },
genres: [ 'Adventure', 'Fantasy' ],
title: 'The Lord of the Rings: The Return of the King'
},
{
imdb: { votes: 1080566 },
genres: [ 'Action', 'Sci-Fi' ],
title: 'The Matrix'
},
{
imdb: { votes: 1004805 },

www.dumpsplanet.com
genres: [ 'Action', 'Thriller' ],
title: 'The Dark Knight Rises'
}
]
Which pipeline should you use?
A. [{ $match: { genres: { $nin: ['Drama'] }, 'imdb.votes': { $gte: 100
} }}, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 }}, { $sort:
{ 'imdb.votes': -1 }}, { $limit: 5}]
B. [{ $match: { genres: { $in: ['Drama'] }, 'imdb.votes': { $gte: 100
} }}, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 }}, { $sort: {
'imdb.votes': -1 }}, { $limit: 5}]
C. [{ $match: { genres: { $nin: ['Drama'] }, 'imdb.votes': { $gte: 100
} }}, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 }}, { $sort:
{ 'imdb.votes': -1 }}]

Correct Answer: A

Explanation/Reference:

https://docs.mongodb.com/manual/aggregation/

QUESTION 6

Select true statements about the naming convention of collections in MongoDB.


A. Empty string '' cannot be a collection name.
B. Don't create collections that start with system.
C. Collection names should not contain $ sign.

Correct Answer: A,B,C

QUESTION 7

Let's consider a one-to-many relationship observed between an instructor and the courses he is
created on an e-learning platform. We assume that a course can only have one instructor, and an
instructor can have multiple courses.
Which of the following are the correct ways to represent this one-to-many relationship with a
document model in MongoDB?
A. Have a collection for the instructors and a collection for the courses with each course document
having a field to reference the document of its instructor.
B. Embed all the fields for a course as a subdocument in the corresponding instructor document.
C. Embed the entities for the courses as an array of sub-documents in the corresponding instructor
document.

www.dumpsplanet.com
Correct Answer: A,C

Explanation/Reference:

Embed all the fields for a course as a subdocument in the corresponding instructor document.
These subdocuments must be put into an array, not stored directly as a subdocument in its parent.
This way we can have a variable number of referenced documents and use a multi-key index to
search the "many" side. This is not the best way to do it.
https://docs.mongodb.com/manual/tutorial/model-embedded-one-to-many-relationships-between-
documents/

QUESTION 8

We have a movies collection with the following document structure:


{
_id: ObjectId("573a1390f29313caabcd6223"),
genres: [ 'Comedy', 'Drama', 'Family' ],
title: 'The Poor Little Rich Girl',
released: ISODate("1917-03-05T00:00:00.000Z"),
year: 1917,
imdb: { rating: 6.9, votes: 884, id: 8443 }
}
We need to use Aggregation Framework to fetch all movies from this collection where 'Drama' is in
genres list and the minimum 'imdb.votes' is at least 100. Additionally, in the projection stage, we
want to leave only the following fields:
-> title
-> genres
-> imdb.votes
We also want to sort the result set by decreasing imdb votes.
Example output:
[
{
imdb: { votes: 1521105 },
genres: [ 'Crime', 'Drama' ],
title: 'The Shawshank Redemption'
},
{
imdb: { votes: 1513145 },
genres: [ 'Crime', 'Drama' ],
title: 'The Shawshank Redemption'
},
{
imdb: { votes: 1495351 },
genres: [ 'Action', 'Crime', 'Drama' ],
title: 'The Dark Knight'

www.dumpsplanet.com
},
...
Which pipeline should you use?
A. [{ $match: { genres: { $in: ['Drama'] }, 'imdb.votes': { $gte: 100
} }}, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 }}, { $limit:
{ 'imdb.votes': -1 }}]
B. [{ $match: { genres: { $in: ['Drama'] }, 'imdb.votes': { $gte: 100
} }}, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 }}, { $sort: {
'imdb.votes': -1 }}]
C. [{ $match: { genres: { $in: ['Drama'] }, 'imdb.votes': { $gte: 100
} }}, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 }}, { $sort: {
'imdb.votes': 1 }}]

Correct Answer: B

Explanation/Reference:

https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/

QUESTION 9

Select all true statements regarding to $match stage in Aggregation Framework.


A. It can only be used once in the aggregation pipeline.
B. It has a syntax similar to find() method.
C. We should use $match stage as early as possible in the aggregation pipeline.

Correct Answer: B,C

Explanation/Reference:

https://docs.mongodb.com/manual/reference/operator/aggregation/match/

QUESTION 10

Which of the following commands will delete a collection named restaurants?


A. db.restaurants.remove()
B. db.restaurants.delete()
C. db.restaurants.drop()
D. db.restaurants.dropCollection()

www.dumpsplanet.com
Correct Answer: C

Explanation/Reference:

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

QUESTION 11

Select all options where you should use sharding.


A. Your organization outgrows the most powerful servers available, which limits your vertical scaling
capabilities.
B. You have over 6TB per server and operating costs are increasing dramatically.
C. Every time you start a new project with MongoDB.
D. Your server disks are full, but you can scale up.

Correct Answer: A,B

Explanation/Reference:

https://docs.mongodb.com/manual/sharding/

QUESTION 12

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)
A. This insert is unordered.
B. Two documents will be inserted into the collection.
C. One document will be inserted into the collection.
D. Three documents will be inserted into the collection.
E. MongoDB will insert each document with a unique _id value into the collection.

Correct Answer: A,D,E

www.dumpsplanet.com
Explanation/Reference:

https://docs.mongodb.com/manual/reference/method/db.collection.insertMany/

QUESTION 13

Select all true statements about differences between using aggregate() and find() methods?
A. Any find() query can be translated into an aggregation pipeline.
B. find() allows us to compute and reshape data in the cursor.
C. aggregate() allows us to compute and reshape data in the cursor (like $group, $min and other
stages).
D. Any aggregation pipeline can be translated into a find() query.

Correct Answer: A,C

Explanation/Reference:

https://docs.mongodb.com/manual/reference/method/db.collection.find/
https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/

QUESTION 14

We have the following index in a movies collection:


{ title: 1, genres: 1 }
We want to insert the following document:
{
"title": "The Immigrant",
"year": 1917,
"genres": [
"Short",
"Comedy",
"Drama"
]
}
How many index entries will be created?
A. 0
B. 4
C. 1
D. 2
E. 3

Correct Answer: E

www.dumpsplanet.com
Explanation/Reference:

https://docs.mongodb.com/manual/indexes/

QUESTION 15

Which cursor method should you use to get information about the query plan?
A. cursor.map()
B. cursor.hint()
C. cursor.explain()

Correct Answer: C

Explanation/Reference:

https://docs.mongodb.com/manual/reference/method/cursor.explain/

QUESTION 16

How many indexes will the following command create?


db.products.createIndex( { product_name: 1, product_category: -1 } )
A. 1
B. 3
C. 0
D. 2

Correct Answer: A

Explanation/Reference:

https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/

QUESTION 17

The following capped collection is given:


db.createCollection('latest_news', {'capped': true, 'size': 10000, 'max': 3})
[
{
_id: ObjectId("61e8007c9b3067e362440a88"),
title: 'COVID records broken again as weekend brings nearly 40K new cases'
},
{

www.dumpsplanet.com
_id: ObjectId("61e800989b3067e362440a89"),
title: 'Bitcoin, Ethereum, Dogecoin Face Fresh Round Of Regulatory Scrutiny'
},
{
_id: ObjectId("61e800d19b3067e362440a8a"),
title: 'Where Six Meme Stock Investors Are Now'
}
]
What the latest_news collection will look like after the following operation?
db.latest_news.insertOne({title: 'TikTok owner ByteDance dissolves its investment arm'})
A. [ { _id: ObjectId("61e8007c9b3067e362440a88"), title: 'COVID records broken again as
weekend brings nearly 40K new cases' }, { _id: ObjectId("61e800989b3067e362440a89"),
title: 'Bitcoin, Ethereum, Dogecoin Face Fresh Round Of Regulatory Scrutiny' }, { _id:
ObjectId("61e800d19b3067e362440a8a"), title: 'Where Six Meme Stock Investors Are Now' },
{ _id: ObjectId("61e801439b3067e362440a8b"), title: 'TikTok owner ByteDance dissolves its
investment arm' }]
B. [ { _id: ObjectId("61e8007c9b3067e362440a88"), title: 'COVID records broken again as
weekend brings nearly 40K new cases' }, { _id: ObjectId("61e800989b3067e362440a89"),
title: 'Bitcoin, Ethereum, Dogecoin Face Fresh Round Of Regulatory Scrutiny' }, { _id:
ObjectId("61e800d19b3067e362440a8a"), title: 'Where Six Meme Stock Investors Are Now' }]
C. [ { _id: ObjectId("61e800989b3067e362440a89"), title: 'Bitcoin, Ethereum, Dogecoin Face
Fresh Round Of Regulatory Scrutiny' }, { _id: ObjectId("61e800d19b3067e362440a8a"), title:
'Where Six Meme Stock Investors Are Now' }, { _id: ObjectId("61e801439b3067e362440a8b"),
title: 'TikTok owner ByteDance dissolves its investment arm' }]

Correct Answer: C

Explanation/Reference:

https://docs.mongodb.com/manual/core/capped-collections/

QUESTION 18

Which of the following commands can you use to exports data in BSON format from a MongoDB
cluster?
A. mongostore
B. mongodump
C. mongoimport
D. mongoexport

Correct Answer: B

www.dumpsplanet.com
Explanation/Reference:

https://docs.mongodb.com/database-tools/mongodump/

QUESTION 19

Select all default configurations for mongod.


A. By default, mongod is only bound to localhost (or 127.0.0.1).
B. By default, mongod doesn't enforce authentication.
C. The default port for mongod is 27017.
D. The default data directory for mongod is /data/db

Correct Answer: A,B,C,D

Explanation/Reference:

https://docs.mongodb.com/manual/reference/configuration-options/

QUESTION 20

Which of the following roles provides minimal privileges needed for backing up data in MongoDB?
A. backup
B. restore
C. update

Correct Answer: A

Explanation/Reference:

https://docs.mongodb.com/manual/reference/built-in-roles/#mongodb-authrole-backup

QUESTION 21

Which of the following statements are true about the mongo shell? Check all that apply.
A. Mongo shell is a fully functioning JavaScript interpreter (which means that we can create things
like JavaScript variables and functions in mongo shell).
B. The mongo shell doesn't return documents in sorted order by default.
C. You can get a sorted set of documents by using the sort() method.
D. Mongo shell allows us to interact with MongoDB instance without using GUI.

www.dumpsplanet.com
Correct Answer: A,B,C,D

Explanation/Reference:

https://docs.mongodb.com/manual/reference/mongo-shell/

QUESTION 22

Select properly used $out operator.


A. db.collection.aggregate([ { stage1 }, { $out: "new_collection" }, { stage2 }, ..., {
stageN }])
B. db.collection.aggregate([ { $out: "new_collection" }, { stage1 }, { stage2 },
..., { $stageN }])
C. db.collection.aggregate([ { stage1 }, { stage2 }, ..., { stageN }, { $out:
"new_collection" }])

Correct Answer: C

Explanation/Reference:

https://docs.mongodb.com/manual/reference/operator/aggregation/out/

QUESTION 23

Select all true statements about replication in MongoDB.


A. Replication is also used to prevent downtime in the event of a failure in a data center.
B. It's a good practice to have replicas in different geographical regions. If one region becomes
unavailable due to a major failure in a data center or the network connection to it, the applications
will continue to run without downtime.

Correct Answer: A,C

Explanation/Reference:

https://docs.mongodb.com/manual/replication/#replication

QUESTION 24

Select scenarios that are best suited for applying the Schema Versioning Pattern.
A. There is a requirement to keep multiple versions of a document, and those versions can have

www.dumpsplanet.com
different fields for each version in your application.
B. Your team was assigned to update the current schema with additional fields without shutting
down the system for this upgrade. However, all documents need to be quickly updated.

Correct Answer: A,B

Explanation/Reference:

https://www.mongodb.com/blog/post/building-with-patterns-the-schema-versioning-pattern

www.dumpsplanet.com
2023

About dumpsplanet.com

dumpsplanet.com's free demo will give you a complete product idea. We provide latest & high
quality IT / Business Certification Training Exam Questions in PDF Format.

We help you pass any IT / Business Certification Exams with 100% Pass Guaranteed. Especially
Microsoft, Cisco, CompTIA, Citrix, EMC, HP, Oracle, VMware, Juniper, Check Point, LPI, Nortel,
EXIN and so on.

View list of all certification exams: All Exams

Start Your C100DEV Preparation


https://www.dumpsplanet.com/c100dev-dumps/

[Limited Time Offer] Use Coupon 'dp25%' for extra 25% discount on the purchase of PDF Dumps.
Test your C100DEV preparation with actual C100DEV exam questions.

We prepare state-of-the art practice tests Questions for All IT certification exams. You can reach us
with from Contact Us Page. Any problems about IT certification or our products, you can write us
back and we will get back to you within 24 hours.

www.dumpsplanet.com

You might also like