
New 2023 C100DEV exam questions Welcome to download the newest Free4Dump C100DEV PDF dumps (253 Q&As)
P.S. Free 2023 MongoDB Certified Developer Associate C100DEV dumps are available on Google Drive shared by Free4Dump
NEW QUESTION # 66
Which of the following scenarios is best suited for applying the Attribute Pattern?
- A. You need to apply document validation before inserting/modifying.
- B. The documents in the collection are quite large.
- C. Some fields share a similar characteristics, and you want to search across those fields.
Answer: C
Explanation:
https://www.mongodb.com/blog/post/building-with-patterns-the-attribute-pattern
NEW QUESTION # 67
Given a flights collection that is sharded on the following shard key: { "airline_id" : 1, "departure_airport" : 1 } Which of the following queries results in a targeted query?
- A. db.flights.find( { airline_id: 2946863, departure_airport: "JFK" } )
- B. db.flights.find( { departure_airport: "JFK" } )
- C. db.flights.find( { airline_id: 2946863 } )
- D. db.flights.find( { departure_airport: "JFK", airline_id: 2946863 } )
Answer: A,C,D
Explanation:
db.flights.find( { departure_airport: "JFK" } ) This query doesn't include the airline_id prefix, and cannot be targeted. https://docs.mongodb.com/manual/core/sharding-shard-key/
NEW QUESTION # 68
A social media company needs to implement a data model that describes te relationships between users. When loading real data into the system, it turned out that one user has too many contacts to store them in the designated array. Instead of redesigning the entire system what pattern can you use?
- A. The Outlier Pattern.
- B. The Attribute Pattern.
- C. The Schema Versioning Pattern.
- D. The Extended Reference Pattern.
- E. The Subset Pattern.
Answer: A
Explanation:
https://www.mongodb.com/blog/post/building-with-patterns-the-outlier-pattern
NEW QUESTION # 69
Select all true statements about differences between using aggregate() and find() methods?
- A. Any find() query can be translated into an aggregation pipeline.
- B. Any aggregation pipeline can be translated into a find() query.
- C. aggregate() allows us to compute and reshape data in the cursor (like $group, $min and other stages).
- D. find() allows us to compute and reshape data in the cursor.
Answer: A,C
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.find/ https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/
NEW QUESTION # 70
Can you perform the following operation?
db.users.insertOne({})
- A. Yes, it will only insert a document without any fields.
- B. No, it will throw an error.
- C. Yes, it will only insert a document with an _id field (auto-generated).
Answer: C
NEW QUESTION # 71
Which of the following processes are heavily reliant on available CPU?
- A. Read operations
- B. Write operations
- C. Aggregation
Answer: A,B,C
NEW QUESTION # 72
Select all true statements about elections (replica set).
- A. Not all nodes have equal chances to become the primary node.
- B. Nodes with a higher priority are more likely to be selected as primary node.
- C. Elections can take place anytime while the primary is available.
- D. Setting a node's priority to 0 ensures that a node never becomes primary.
Answer: A,B,D
Explanation:
https://docs.mongodb.com/manual/replication/#replication-in-mongodb
NEW QUESTION # 73
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 }
How many documents will be deleted when executing the following query?
db.companies.deleteMany( { "category_code": "advertising" } )
- A. 0
- B. 1
- C. 2
- D. 3
Answer: C
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.deleteMany/
NEW QUESTION # 74
Suppose you have a movies collection with the following document structure: { _id: ObjectId("573a1390f29313caabcd60e4"), title: 'The Immigrant', fullplot: "Charlie is on his way to the USA. He wins in a card game, puts the money in Edna's bag (she and her sick mother have been robbed of everything). When he retrieves a little for himself he is accused of being a thief. Edna clears his name. Later, broke, Charlie finds a coin and goes into a restaurant." } You want to sort result set by a relevance score computed by MongoDB in text search query and extract only three documents with the highest score. Which query do you need to use?
- A. db.movies.find( { $text: { $search: 'spaceship' } }, { score: { $meta: 'textScore' } }, ).sort( { score: { $meta: 'textScore' } } )
- B. db.movies.find( { $text: { $search: 'spaceship' } }, { score: { $meta: 'textScore' } }, ).sort( { score: { $meta: 'textScore' } } ).limit(3)
- C. db.movies.find( {}, { score: { $meta: 'textScore' } }, ).sort( { score: { $meta: 'textScore' } } ).limit(3)
Answer: B
Explanation:
https://docs.mongodb.com/manual/text-search/ https://docs.mongodb.com/manual/core/index-text/
NEW QUESTION # 75
Select all true statements about text search in MongoDB.
- A. A collection can only have one text search index, but that index can cover multiple fields.
- B. To perform text search queries, you must have a text index on your collection.
- C. To perform text searches on a collection we use $text operator.
- D. Text indexes cannot include any field whose value is an array of string elements.
- E. MongoDB provides text indexes to support text search queries on string content.
- F. Text indexes can include any field whose value is a string.
Answer: A,B,C,E,F
Explanation:
https://docs.mongodb.com/manual/text-search/
NEW QUESTION # 76
Select properly used $out operator.
- A. db.collection.aggregate([ { stage1 }, { stage2 }, ..., { stageN }, { $out: "new_collection" } ])
- B. db.collection.aggregate([ { stage1 }, { $out: "new_collection" }, { stage2 }, ..., { stageN } ])
- C. db.collection.aggregate([ { $out: "new_collection" }, { stage1 }, { stage2 }, ..., { $stageN } ])
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/out/
NEW QUESTION # 77
Which of the following commands will successfully insert exactly two new documents into an empty companies collection?
- A. db.companies.insertMany([ {"_id": 1, "name": "Facebook"}, {"_id": 2, "name": "Twitter"} ])
- B. db.companies.insertMany([ {"_id": 1, "name": "Facebook"}, {"_id": 2, "name": "Twitter"}, {"_id": 2, "name": "Tesla"} ])
- C. db.companies.insertMany([ {"_id": 1, "name": "Facebook"}, {"_id": 1, "name": "Twitter"}, {"_id": 2, "name": "Tesla"} ], {"ordered": false})
- D. db.companies.insertMany([ {"_id": 1, "name": "Facebook"}, {"_id": 1, "name": "Twitter"}, {"_id": 2, "name": "Tesla"} ])
- E. db.companies.insertMany([ {"name": "Facebook"}, {"name": "Twitter"} ])
Answer: A,B,C,E
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.insertMany/
NEW QUESTION # 78
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 # 79
Which of the following actions are granted to the built-in read role?
- A. find
- B. update
- C. insert
- D. remove
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/built-in-roles/#mongodb-authrole-read
NEW QUESTION # 80
You have to create a simple configuration file for mongod instance. Here are the requirements of your mongod instance: * run on port 27100 * authentication is enabled Which of the following configuration file meet these requirements?
- A. net:
port: 27100
security:
authorization: enabled - B. net:
port: 27000
processManagement:
fork: true - C. net:
port: 27100
security:
authorization: disabled
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/configuration-options/
NEW QUESTION # 81
Select all true statements about $lookup and $graphLookup operators.
- A. $graphLookup stage cannot be used without $lookup stage.
- B. $lookup stage performs a recursive search on a collection, with options for restricting the search by recursion depth and query filter.
- C. $graphLookup stage provides graph-like capabilities.
Answer: C
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.countDocuments/
NEW QUESTION # 82
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. Embed all the fields for a course as a subdocument in the corresponding instructor document.
- B. 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.
- C. Embed the entities for the courses as an array of sub-documents in the corresponding instructor document.
Answer: B,C
Explanation:
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/
NEW QUESTION # 83
Which of the following read preference options may not result in out-of-date data?
- A. primary
- B. nearest
- C. secondary
- D. primaryPreferred
- E. secondaryPreferred
Answer: A
Explanation:
If you are using any other read preferences other than primary, data may be read from the secondary node, which may result in reading slightly outdated data. https://docs.mongodb.com/manual/replication/#replication-in-mongodb
NEW QUESTION # 84
Suppose you have a restaurants collection with the following document structure: { _id: ObjectId("5eb3d668b31de5d588f42931"), address: { building: '6409', coord: [ -74.00528899999999, 40.628886 ], street: '11 Avenue', zipcode: '11219' }, borough: 'Brooklyn', cuisine: 'American', grades: [ { date: ISODate("2014-07-18T00:00:00.000Z"), grade: 'A', score: 12 }, { date: ISODate("2013-07-30T00:00:00.000Z"), grade: 'A', score: 12 }, { date: ISODate("2013-02-13T00:00:00.000Z"), grade: 'A', score: 11 }, { date: ISODate("2012-08-16T00:00:00.000Z"), grade: 'A', score: 2 }, { date: ISODate("2011-08-17T00:00:00.000Z"), grade: 'A', score: 11 } ], name: 'Regina Caterers', restaurant_id: '40356649' } You don't have any indexes so far. What will the query plan look like for the following query?
db.restaurants.find( { "cuisine": "American" } )
- A. COLLSCAN
- B. IXSCAN
Answer: A
Explanation:
https://docs.mongodb.com/manual/indexes/
NEW QUESTION # 85
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) -> total_score_with_bonus (total_score + bonus) Expected output: [ { _id: 1, user: 'Tom', scores: [ 23, 56, 3, 52, 62 ], bonus: 5, total_score: 196, avg_score: 39.2, total_score_with_bonus: 201 }, { _id: 2, user: 'Jane', scores: [ 42, 50, 10 ], bonus: 3, total_score: 102, avg_score: 34, total_score_with_bonus: 105 } ]
Which query do you need to use?
- A. db.players.aggregate([{ $addFields: { total_score: { $sum: '$scores' }, avg_score: { $avg: '$scores' } } }, { $addFields: { total_score_with_bonus: { $add: ['$total_score', '$bonus'] } } }])
- B. db.players.aggregate([{ $addFields: { total_score: { $sum: '$scores' }, avg_score: { $avg: '$scores' }, total_score_with_bonus: { $add: ['$total_score', '$bonus'] } } }])
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/ https://docs.mongodb.com/manual/reference/operator/aggregation/addFields/
NEW QUESTION # 86
Which of the following actions are granted to the built-in readWrite role?
- A. find
- B. insert
- C. remove
- D. update
Answer: A,B,C,D
Explanation:
https://docs.mongodb.com/manual/reference/built-in-roles/#mongodb-authrole-readWrite
NEW QUESTION # 87
Select true statements about the naming convention of collections in MongoDB.
- A. Collection names should not contain $ sign.
- B. Don't create collections that start with system.
- C. Empty string '' cannot be a collection name.
Answer: A,B,C
NEW QUESTION # 88
Suppose you insert the following documents into a companies collection:
db.companies.insertMany([ {"name": "Facebook"}, {"name": "Twitter"} ])
Select all true statements about this command. (select 3)
- A. This command will insert one document into the collection.
- B. MongoDB will automatically create an _id field for each document and it will be unique.
- C. This command will insert two documents into the collection.
- D. The _id field is not specified in any of these documents.
Answer: B,C,D
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.insertMany/
NEW QUESTION # 89
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 } }, { _id: ObjectId("573a13e3f29313caabdc08a4"), genres: [ 'Horror', 'Thriller' ], title: 'Mary Loss of Soul', year: 2014, imdb: { rating: '', votes: '', id: 2904798 } } We need to use Aggregation Framework to calculate the following aggregates: -> average imdb rating -> minimum imdb rating -> maximum imdb rating Expected output: [ { _id: null, avg_rating: 6.6934040649367255, min_rating: 1.6, max_rating: 9.6 } ] Please note that some documents have "" (empty string) for the field "imdb.rating". Exclude these documents before aggregation. Which pipeline should you use?
- A. [{ $match: { "imdb.rating": { $ne: "" } } }, { $group: { _id: null, avg_rating: { $avg: "imdb.rating" }, min_rating: { $min: "imdb.rating" }, max_rating: { $max: "imdb.rating" } } }]
- B. [{ $match: { "imdb.rating": { $ne: "" } } }, { $group: { _id: null, avg_rating: { avg: "$imdb.rating" }, min_rating: { min: "$imdb.rating" }, max_rating: { max: "$imdb.rating" } } }]
- C. [{ $group: { _id: null, avg_rating: { $avg: "$imdb.rating" }, min_rating: { $min: "$imdb.rating" }, max_rating: { $max: "$imdb.rating" } } }]
- D. [{ $match: { "imdb.rating": { $ne: "" } } }, { $group: { _id: null, avg_rating: { $avg: "$imdb.rating" }, min_rating: { $min: "$imdb.rating" }, max_rating: { $max: "$imdb.rating" } } }]
Answer: D
Explanation:
https://docs.mongodb.com/manual/aggregation/
NEW QUESTION # 90
......
C100DEV exam questions from Free4Dump dumps: https://www.free4dump.com/C100DEV-braindumps-torrent.html (253 Q&As)
Free 2023 MongoDB Certified Developer Associate C100DEV dumps are available on Google Drive shared by Free4Dump: https://drive.google.com/open?id=1kOpdMpj9LBxAFR11MsZmN54_QepabIcW