2023 Valid C100DEV Real Exam Questions, practice MongoDB Certified Developer Associate [Q132-Q155]

Share

2023 Valid C100DEV Real Exam Questions, practice MongoDB Certified Developer Associate

Latest Success Metrics For Actual C100DEV Exam (Updated 253 Questions)

NEW QUESTION # 132
Use case: e-learning platform Which of the following scenarios is the best candidate to use the Computed Pattern?

  • A. Our app needs to retrieve a course and information about its instructor.
  • B. A course model needs to store references to image of the course that are kept in an external location outside the database.
  • C. Our app needs to retrieve a course and its ten most recent reviews.
  • D. A course model needs to store a counter representing the number of times it was purchased.

Answer: D

Explanation:
https://www.mongodb.com/blog/post/building-with-patterns-the-computed-pattern


NEW QUESTION # 133
Select all true statements regarding to replica sets in MongoDB.

  • A. Replica set members have a fixed role assigned.
  • B. Replica sets use failover to provide high availability to client applications.
  • C. We can have up to 50 replica set members, but only 7 of those will be voting members.

Answer: B,C

Explanation:
Replica set members have a fixed role assigned. -> False The availability of the system will be ensured by failing over the role of primary to an available secondary node through an election. https://docs.mongodb.com/manual/replication/


NEW QUESTION # 134
Select true statements about data modeling in MongoDB.

  • A. If one of your application's main queries is to retrieve related information from different collections, it is usually better to group that information into a single document.
  • B. To avoid having to join data in the application layer from different collections you can denormalize your data.
  • C. It's good data modeling practice to directly map each table from the relational model (normalized data) to the collection.

Answer: A,B

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


NEW QUESTION # 135
$group stage can be used multiple times within an aggregation pipeline.

  • A. True
  • B. False

Answer: A

Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/group/


NEW QUESTION # 136
What is MongoDB Charts?

  • A. A feature that displays data about the performance of your Atlas cluster.
  • B. An application that allows you to embed on your website visualizations that are created in other applications.
  • C. MongoDB product that helps you visualize data stored in an Atlas cluster.

Answer: C

Explanation:
https://docs.mongodb.com/charts/


NEW QUESTION # 137
In your database a movies collection is given where each document has the following structure: { _id: ObjectId("573a1391f29313caabcd9264"), genres: [ 'Romance', 'Drama' ], title: 'The Divorcee', languages: [ 'English', 'French' ], year: 1930, imdb: { rating: 6.9, votes: 1740, id: 20827 }, countries: [ 'USA' ] } Which of the following queries will return all movies that are in the Fantasy and Drama (both) genre?

  • A. db.movies.find( { genres: { $size: ['Fantasy', 'Drama'] } } )
  • B. db.movies.find( { genres: { $elemMatch: ['Fantasy', 'Drama'] } } )
  • C. db.movies.find( { genres: { $in: ['Fantasy', 'Drama'] } } )
  • D. db.movies.find( { genres: { $all: ['Fantasy', 'Drama'] } } )

Answer: D

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


NEW QUESTION # 138
Suppose you have a sales collection with the following document structure: { _id: ObjectId("5bd761dcae323e45a93ccfe8"), saleDate: ISODate("2015-03-23T21:06:49.506Z"), items: [ { name: 'printer paper', tags: [ 'office', 'stationary' ], price: Decimal128("40.01"), quantity: 2 } { name: 'pens', tags: [ 'writing', 'office', 'school', 'stationary' ], price: Decimal128("56.12"), quantity: 5 }, { name: 'notepad', tags: [ 'office', 'writing', 'school' ], price: Decimal128("18.47"), quantity: 2 } ], storeLocation: 'Denver', couponUsed: true, purchaseMethod: 'Online' } Which of the following queries will return all document sales with 'printer paper' sold?

  • A. db.sales.find( { items: { elemMatch: { name: 'printer paper' } } } )
  • B. db.sales.find( { items: { $elemMatch: { name: 'printer paper' } } } )
  • C. db.sales.find( { items: { $match: { name: 'printer paper' } } } )

Answer: B

Explanation:
Explanation: https://docs.mongodb.com/manual/reference/operator/query/elemMatch/


NEW QUESTION # 139
How to connect to mongod instance and authenticate as root?

  • A. mongo --authenticationDatabase admin
  • B. mongoroot --authenticationDatabase admin
  • C. mongo --username root --password root123 --authenticationDatabase admin

Answer: C

Explanation:
https://docs.mongodb.com/v4.4/mongo/#mongodb-instance-with-authentication


NEW QUESTION # 140
A collection called players contains documents with the following structure: { _id: 1, user: 'Tom', scores: [ 23, 56, 3, 52, 62 ], bonus: 5 } { _id: 2, user: 'Jane', scores: [ 42, 50, 10 ], bonus: 3 } You have the following query: db.players.aggregate([{ $addFields: { total_score: { $sum: '$scores' }, avg_score: { $avg: '$scores' } } }, { $addFields: { total_score_with_bonus: { $add: ['$total_score', '$bonus'] } } }, { $match: { bonus: { $gt: 4 } } }]) How can you optimize this query?

  • A. Moving the $match stage to the beginning of the pipeline. [{ $match: { bonus: { $gt: 4 } } }, { $addFields: { total_score: { $sum: '$scores' }, avg_score: { $avg: '$scores' } } }, { $addFields: { total_score_with_bonus: { $add: ['$total_score', '$bonus'] } } }]
  • B. Moving the $match stage to the second stage of this pipeline. [{ $addFields: { total_score: { $sum: '$scores' }, avg_score: { $avg: '$scores' } } }, { $match: { bonus: { $gt: 4 } } }, { $addFields: { total_score_with_bonus: { $add: ['$total_score', '$bonus'] } } }]
  • C. This query cannot be optimized.

Answer: A

Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/match/ https://docs.mongodb.com/manual/core/aggregation-pipeline-optimization/


NEW QUESTION # 141
Where is collection metadata stored in a sharded cluster?

  • A. On the configuration servers.
  • B. In a random shard.
  • C. In the primary shard.

Answer: A

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


NEW QUESTION # 142
Select all true statements about the update operation. (select 2)

  • A. updateOne() method with the $set operator updates the first document that matches the query.
  • B. If the field doesn't exist, updateOne() method with the $set operator will not add a new field with the specified value.
  • C. updateOne() method with the $set operator updates an existing document field with the given value.

Answer: A,C

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


NEW QUESTION # 143
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?
db.movies.find( { "title": "James Bond", "imdb.rating": { "$gt": 8} } ).sort( { "imdb.rating": 1 } )

  • A. No
  • B. Yes

Answer: B

Explanation:
Yes, although this query does not use equality in the "imdb.rating" field of the index prefix, it does use the same field for sorting. https://docs.mongodb.com/manual/indexes/


NEW QUESTION # 144
Where is the MongoDB configuration file usually located?

  • A. /var/log/mongod.conf
  • B. /home/user/mongod.conf
  • C. /bin/mongod.conf
  • D. /tmp/mongod.conf
  • E. /etc/mongod.conf

Answer: E

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


NEW QUESTION # 145
A collection called players contains the following documents: [ { _id: 1, user: 'Tom', scores: [ 23, 56, 3, 52, 62 ], bonus: 5 }, { _id: 2, user: 'Jane', scores: [ 42, 50, 10 ], bonus: 3 } ] You want to add additional fields to each document: -> total_score (sum of the scores Array) -> avg_score (average score in scores Array) Expected output: [ { _id: 1, user: 'Tom', scores: [ 23, 56, 3, 52, 62 ], bonus: 5, total_score: 196, avg_score: 39.2 }, { _id: 2, user: 'Jane', scores: [ 42, 50, 10 ], bonus: 3, total_score: 102, avg_score: 34 } ] Which query do you need to use?

  • A. db.players.aggregate([{ $addFields: { total_score: { $sum: 'scores' }, avg_score: { $avg: 'scores' } } }])
  • B. db.players.aggregate([{ $addFields: { total_score: { $sum: '$scores' }, avg_score: { $avg: '$scores' } } }])
  • C. db.players.aggregate([{ $add: { total_score: { $sum: '$scores' }, avg_score: { $avg: '$scores' } } }])

Answer: B

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


NEW QUESTION # 146
Select all true statements regarding to schema validation in MongoDB.

  • A. MongoDB doesn't provide the capability to perform schema validation during updates and insertions.
  • B. Validation rules are on a per-collection basis.
  • C. We need to use db.createCollection() with the validator option to specify validation rules for a new collection.

Answer: B,C

Explanation:
https://docs.mongodb.com/manual/core/schema-validation/


NEW QUESTION # 147
How can we present the basic syntax for aggregation in MongoDB?

  • A. db.myCollection.aggregate([ { options } { stage1 }, { stage2 }, ..., { stageN } ])
  • B. db.myCollection.aggregate([ { stage1 }, { stage2 }, ..., { stageN } ], { options } )
  • C. db.myCollection.aggregate([ { stage1 }, { stage2 }, ..., { stageN }, { options } ])

Answer: B

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


NEW QUESTION # 148
What do you mean by collection scan during query execution?

  • A. It can use the index to limit the number of documents it must check.
  • B. It scans every document in a collection, to select those documents that match the query.

Answer: B

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


NEW QUESTION # 149
Suppose you have a developers collection with only two documents:
{ _id: 1, lname: 'Smith', tech_stack: [ 'sql', 'git', 'python', 'django' ], fname: 'Bob' }, { _id: 2, fname: 'Michael', lname: 'Doe', tech_stack: [ 'git', 'python', 'sqlite', 'linux', 'flask' ] }
Using Aggregation Framework you run the following stage:
{ $unwind: { path: '$tech_stack' } }
How many documents will you have in the pipeline after the $unwind stage?

  • A. 0
  • B. 1
  • C. 2
  • D. 3
  • E. 4

Answer: B

Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/


NEW QUESTION # 150
Which of the following commands will add a collection that is stored in JSON file to a MongoDB cluster?

  • A. mongodump
  • B. mongoexport
  • C. mongoimport
  • D. mongostore

Answer: C

Explanation:
https://docs.mongodb.com/database-tools/mongoimport/


NEW QUESTION # 151
Can you create a unique index in MongoDB?

  • A. No
  • B. Yes

Answer: B

Explanation:
https://docs.mongodb.com/manual/core/index-unique/


NEW QUESTION # 152
In which situations can we consider sharding?

  • A. Our dataset is too big to fit in one MongoDB instance.
  • B. It takes too long to backup and restore the data set.
  • C. We want to improve read performance for our application.
  • D. A new developer will join your development team soon.

Answer: A,B,C

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


NEW QUESTION # 153
Suppose you have a products collection with an index: { product_category: 1 } For which of the following queries can MongoDB look at only a subset of the index entries, rather than all of the index entries?

  • A. db.products.find( { product_category: /S./ } )
  • B. db.products.find( { product_category: /A./ } )
  • C. db.products.find( { product_category: /^A./ } )

Answer: C

Explanation:
https://docs.mongodb.com/manual/reference/operator/query/regex/


NEW QUESTION # 154
In your database there is a movies collection with the following document structure: { _id: ObjectId("573a1390f29313caabcd42e8"), genres: [ 'Short', 'Western' ], title: 'The Great Train Robbery', rated: 'TV-G', year: 1903, imdb: { rating: 7.4, votes: 9847, id: 439 }, countries: [ 'USA' ] }, { _id: ObjectId("573a1390f29313caabcd4323"), genres: [ 'Short', 'Drama', 'Fantasy' ], rated: 'UNRATED', title: 'The Land Beyond the Sunset', year: 1912, imdb: { rating: 7.1, votes: 448, id: 488 }, countries: [ 'USA' ] } In some documents, where there is no rating information for movie, the value is set to '' (empty string). With that in mind, which of the following queries will return the title and rating (see below) of top 3 rated movies in this collection?

  • A. db.movies.find( {}, { _id: 0, title: 1, 'imdb.rating': 1 } ).sort( { 'imdb.rating': 1 } ).limit(3)
  • B. db.movies.find( { 'imdb.rating': { $ne: '' } }, { _id: 0, title: 1, 'imdb.rating': 1 } ).sort( { 'imdb.rating': 1 } ).limit(3)
  • C. db.movies.find( { 'imdb.rating': { $ne: '' } }, { _id: 0, title: 1, 'imdb.rating': 1 } ).sort( { 'imdb.rating': -1 } ).limit(3)
  • D. db.movies.find( { 'imdb.rating': { $eq: '' } }, { _id: 0, title: 1, 'imdb.rating': 1 } ).sort( { 'imdb.rating': -1 } ).limit(3)

Answer: C

Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.sort/


NEW QUESTION # 155
......

Genuine C100DEV Exam Dumps Free Demo Valid QA's: https://pass4sure.dumps4pdf.com/C100DEV-valid-braindumps.html