0% found this document useful (0 votes)
5 views6 pages

C100dev Demo

c100dev Demo

Uploaded by

jassonroy3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views6 pages

C100dev Demo

c100dev Demo

Uploaded by

jassonroy3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

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://validquestions.com/exam/c100dev-questions/
Questions & Answers PDF Page 1

Question: 1

We have a movies collection with the following document structure:

1. {
2. _id: ObjectId("573a1390f29313caabcd6223"),
3. genres: [ 'Comedy', 'Drama', 'Family' ],
4. title: 'The Poor Little Rich Girl',
5. released: ISODate("1917-03-05T00:00:00.000Z"),
6. year: 1917,
7. imdb: { rating: 6.9, votes: 884, id: 8443 }
8. }

We need to extract all movies from this collection where genres includes
both 'Crime' and 'Mystery' . Which query should we use?

A. 1. db.movies.find( { genres: { $any: ["Crime", "Mystery"] } } )


B. 1. db.movies.find( { genres: { $all: ["Crime", "Mystery"] } } )
C. 1. db.movies.find( { genres: { $nin: ["Crime", "Mystery"] } } )
D. 1. db.movies.find( { genres: { $in: ["Crime", "Mystery"] } } )

Answer: B

Explanation:

https://docs.mongodb.com/manual/reference/operator/query/all/

Question: 2

You have the following query:

1. db.gamers.find(
2. { "level": { "$gte" : 70 }, "map": "Inferno" }
3. ).sort( { "points": 1, "group": 1 } )

Which of the following indexes best supports this query? Keep in mind the equality, sort,
range rule.

A. 1. { points: 1, group: 1, level: 1, map: 1 }


B. 1. { level: 1, map: 1, points: 1, group: 1 }

C. 1. { points: 1, group: 1, map: 1, level: 1 }

D. 1. { map: 1, points: 1, group: 1, level: 1 }

www.validquestions.com
Questions & Answers PDF Page 2

Answer: D
Explanation:

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

Question: 3
Consider a MongoDB collection named employees with the following document:

1. {
2. "_id": ObjectId("6151c3d524a78c1854b628a3"),
3. "name": "John Smith",
4. "age": 35,
5. "department": "IT",
6. "salary": 5000,
7. "languages": ["Java", "Python", "JavaScript"],
8. "address": {
9. "street": "123 Main Street",
10. "city": "New York",
11. "state": "NY",
12. "zipcode": "10001"
13. }
14. }

Which of the following statements accurately describe the data types used in
the employees collection? Select three correct answers.

A. The data type of the "department" field is Boolean.

B. The data type of the "_id" field is ObjectId.

C. The data type of the "name" field is String.

D. The data type of the "address" field is Object.

E. The data type of the "salary" field is Float.

Answer: B, C, D

Explanation:

The data type of the "_id" field is ObjectId. -> Correct. The "_id" field uses the ObjectId data type,
which is a unique identifier automatically generated by MongoDB for each document in a
collection.

The data type of the "name" field is String. -> Correct. The "name" field uses the String data type,
representing a sequence of characters for storing the employee's name.

www.validquestions.com
Questions & Answers PDF Page 3

The data type of the "address" field is Object. -> Correct. The "address" field uses the Object data
type, representing a nested document with sub-fields like "street", "city", "state", and "zipcode".

The data type of the "department" field is Boolean. -> Incorrect. The "department" field does not
use the Boolean data type. Instead, it uses the String data type to store the name of the
department.

The data type of the "salary" field is Float. -> Incorrect. The "salary" field does not use the Float
data type. Instead, it uses the 32-bit or 64-bit Integer data type to store the employee's salary.

Question: 4

Consider a MongoDB database containing a collection of documents representing


employee records for a company. The documents have the following structure:

1. {
2. "_id": ObjectId("5f95a1d11a12b400001b75c0"),
3. "employee_id": "EMP-001",
4. "name": {
5. "first": "John",
6. "last": "Doe"
7. },
8. "department": "Sales",
9. "hire_date": ISODate("2022-01-01T00:00:00.000Z"),
10. "salary": 65000,
11. "performance_rating": 4
12. }

You are frequently running the following query to find all employees hired after a certain
date, with a specific department and performance rating:

1. db.employees.find({
2. "hire_date": {
3. "$gte": ISODate("2022-01-01T00:00:00.000Z")
4. },
5. "department": "Sales",
6. "performance_rating": 4
7. })

What index would you create to improve the performance of this query?

A. You should create a compound index on the department ,


and performance_rating fields.

B. You should create a compound index on the performance_rating , department ,


and hire_date fields.

C. You should create an index on the hire_date field.

D. You should create a compound index on the hire_date , department ,


and performance_rating fields.

www.validquestions.com
Questions & Answers PDF Page 4

Answer: D

Explanation:

You should create a compound index on the hire_date , department ,


and performance_rating fields. -> Correct. The query you are running performs a query
on three fields, hire_date , department , and performance_rating , and a compound index
on these fields will improve the query performance. A compound index is an index that
includes multiple fields in the index key, allowing the index to support queries that filter
or sort data based on multiple fields. In this case, a compound index on
the hire_date , department , and performance_rating fields will allow the MongoDB
query planner to use the index to quickly filter the documents based on the hire date,
department, and performance rating criteria, reducing the amount of data that needs to
be scanned and improving the query performance. The index order is also important, as
MongoDB will use the left-most prefix of the index in order, so the order of the fields in
the compound index should match the order of the fields in the query conditions for
optimal performance.

Question: 5

Assign typical operational tasks to the Mongo Developer.

A. write data, read data


B. create user, create index
C. read data

Answer: A

www.validquestions.com
Thank You for trying C100DEV PDF Demo

https://validquestions.com/exam/c100dev-questions/

Start Your C100DEV Preparation

[Limited Time Offer] Use Coupon " SAVE20 " for extra 20%
discount the purchase of PDF file. Test your
C100DEV preparation with actual exam questions

www.validquestions.com

You might also like