
2023 Valid C100DEV Dumps for Helping Passing MongoDB Exam!
Download Free MongoDB C100DEV Exam Questions & Answer
NEW QUESTION # 84
Select all true statements regarding to schema validation in MongoDB.
- A. We need to use db.createCollection() with the validator option to specify validation rules for a new collection.
- B. MongoDB doesn't provide the capability to perform schema validation during updates and insertions.
- C. Validation rules are on a per-collection basis.
Answer: A,C
Explanation:
https://docs.mongodb.com/manual/core/schema-validation/
NEW QUESTION # 85
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: A
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.deleteMany/
NEW QUESTION # 86
Which of the following rules (when ordering) should be followed when building query indexes?
- A. equality, range, sort
- B. range, sort, equality
- C. equality, sort, range
Answer: C
Explanation:
https://www.mongodb.com/blog/post/performance-best-practices-indexing
NEW QUESTION # 87
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 }, genres: [ 'Action', 'Thriller' ], title: 'The Dark Knight Rises' } ] Which pipeline should you use?
- A. [{ $match: { genres: { $in: ['Drama'] }, 'imdb.votes': { $gte: 100 } } }, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 } }, { $sort: { 'imdb.votes': -1 } }, { $limit: 5 }]
- B. [{ $match: { genres: { $nin: ['Drama'] }, 'imdb.votes': { $gte: 100 } } }, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 } }, { $sort: { 'imdb.votes': -1 } }]
- C. [{ $match: { genres: { $nin: ['Drama'] }, 'imdb.votes': { $gte: 100 } } }, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 } }, { $sort: { 'imdb.votes': -1 } }, { $limit: 5 }]
Answer: C
Explanation:
https://docs.mongodb.com/manual/aggregation/
NEW QUESTION # 88
MongoDB can benefit from adding more RAM to your servers.
- A. Yes
- B. No
Answer: A
NEW QUESTION # 89
Which of the following read preference options may not result in out-of-date data?
- A. primary
- B. secondary
- C. nearest
- 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 # 90
Is MongoDB a NoSQL database?
- A. Yes
- B. No
Answer: A
Explanation:
https://www.mongodb.com/nosql-explained
NEW QUESTION # 91
Select all true statements about indexes on a field with values of varying data types.
- A. Values are ordered by data type, then by value.
- B. In MongoDB index cannot have different data types.
- C. Values are ordered only by value.
- D. Values are ordered only by data type.
Answer: A
Explanation:
https://docs.mongodb.com/manual/indexes/
NEW QUESTION # 92
Which of the following roles provides the same read-only privileges as read role on all databases except local and config?
- A. readAnyDatabase
- B. userAdminAnyDatabase
- C. readWriteAnyDatabase
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/built-in-roles/#mongodb-authrole-readAnyDatabase
NEW QUESTION # 93
Given a companies collection where each document has the following structure:
{ _id: ObjectId('61a8b90c6d5ce6a7d8fef95e'), name: 'Facebook', tag_list: ['facebook', 'college', 'students', 'network'], description: 'Social network' }
Which of the following commands will add new fields to the updated documents?
- A. db.companies.updateMany({ "name": "Facebook" }, { "$push": { "tag_list": "media" } })
- B. db.companies.updateMany({ "name": "Facebook" }, { "$set": { "country": "USA" } })
- C. db.companies.updateMany({ "name": "Facebook" }, { "$set": { "description": "Social media" } })
Answer: B
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.updateMany/
NEW QUESTION # 94
Given a movies collection where each document has the following structure: { _id: ObjectId("573a1390f29313caabcd60e4"), genres: [ 'Short', 'Comedy', 'Drama' ], title: 'The Immigrant', year: 1917, imdb: { rating: 7.8, votes: 4680, id: 8133 }, countries: [ 'USA' ] } This time we are using the Aggregation Framework to search our database. Which of the following queries will find all movies with a rating greater than 8?
- A. db.movies.aggregate([ { $match: { "imdb.rating": { $gt: 8 } } } ])
- B. db.movies.aggregate([ { $match: { "imdb.rating": { $gte: 8 } } } ])
- C. db.movies.aggregate([ { $match: { imdb.rating: { $gt: 8 } } } ])
Answer: A
Explanation:
db.movies.aggregate([ { $match: { imdb.rating: { $gt: 8 } } } ]) This is incorrect because we need to use quotes in this case. db.movies.aggregate([ { $match: { "imdb.rating": { $gte: 8 } } } ]) This is incorrect because $gte also checks for equality. https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/
NEW QUESTION # 95
Does MongoDB support query operations that perform a text search of string content?
- A. Yes
- B. No
Answer: A
Explanation:
https://docs.mongodb.com/manual/text-search/
NEW QUESTION # 96
We can use this pattern to work with different schema versions. It mainly involves adding a new field to the document structure, such as schema_version. This field will allow our application to know how to handle particular document. Which pattern does this description apply to?
- A. The Outlier Pattern.
- B. The Schema Versioning Pattern.
- C. The Polymorphic Pattern.
- D. The Attribute Pattern.
- E. The Subset Pattern.
Answer: B
Explanation:
https://www.mongodb.com/blog/post/building-with-patterns-the-schema-versioning-pattern
NEW QUESTION # 97
You have a configuration file for mongod instance called mongod.conf in your working directory. How can you launch mongod instance with this configuration file?
- A. mongod --conf mongod.conf
- B. mongod -f mongod.conf
- C. mongod --use mongod.conf
- D. mongod --config mongod.conf
Answer: B,D
Explanation:
https://docs.mongodb.com/manual/reference/configuration-options/#use-the-configuration-file
NEW QUESTION # 98
Which of the following actions are granted to the built-in userAdmin role?
- A. createRole
- B. createUser
- C. dropUser
- D. dropCollection
- E. grantRole
- F. dropRole
Answer: A,B,C,E,F
Explanation:
https://docs.mongodb.com/manual/reference/built-in-roles/#mongodb-authrole-userAdmin
NEW QUESTION # 99
How to correctly create a date (new object of Date type) in MongoDB?
- A. Date()
- B. new Date()
- C. db.Date()
Answer: B
Explanation:
https://docs.mongodb.com/manual/reference/method/Date/
NEW QUESTION # 100
What data structure is used to store the newly created index in MongoDB?
- A. B-tree
- B. Graph
- C. Dictionary
- D. Binary Tree
- E. Heap
Answer: A
Explanation:
https://docs.mongodb.com/manual/indexes/
NEW QUESTION # 101
We have the following indexes in a movies collection: { _id: 1 } { title: 1, year: 1 } Which of the following queries can be covered by one of the given indexes?
- A. db.movies.find( { title: { $in: [ "Death Note", "The Immigrant" ] } }, { _id: 0, title: 1, year: 1 } )
- B. db.movies.find( { genres: "Crime" }, { _id: 0, title: 1, year: 1, genres: 1 } )
- C. db.movies.find( { title: { $in: [ "Death Note", "The Immigrant" ] } }, { _id: 0, title: 1, year: 1, genres: 1 } )
Answer: A
Explanation:
No, this query would use the { title: 1, year: 1 } index, but it is projecting the genres field. https://docs.mongodb.com/manual/core/query-optimization/#covered-query
NEW QUESTION # 102
Which of the following statements are true regarding MongoDB views?
- A. Write operations to views will raise an error.
- B. Views are write only.
- C. MongoDB views themselves don't contain data.
- D. MongoDB views are created on demand and reflect the data in the source collection.
- E. Views are read only.
Answer: A,C,D,E
Explanation:
https://docs.mongodb.com/manual/core/views/
NEW QUESTION # 103
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' ] } Which of the following queries will return only the title for the five oldest movies in this collection?
- A. db.movies.find( {}, { title: 1, _id: 0 } ).sort( { year: 1 } ).limit(5)
- B. db.movies.find( {}, { title: 1 } ).sort( { year: 1 } ).limit(5)
- C. db.movies.find( {}, { title: 1, _id: 0 } ).sort( { year: 1 } ).skip(5)
- D. db.movies.find( {}, { title: 1, _id: 0 } ).sort( { year: 1 } ).skip(5).limit(5)
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.sort/
NEW QUESTION # 104
Suppose you have a books collection with title field. Which of the following queries will return all books with a title ending in 'ian'?
- A. db.movies.find( { title: { $text: /.*ian$/ } } )
- B. db.movies.find( { title: { $regex: /ian/ } } )
- C. db.movies.find( { title: { $regex: /.*ian$/ } } )
- D. db.movies.find( { title: { $regex: /.*ian/ } } )
Answer: C
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/regex/
NEW QUESTION # 105
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( { departure_airport: "JFK" } )
- B. db.flights.find( { departure_airport: "JFK", airline_id: 2946863 } )
- C. db.flights.find( { airline_id: 2946863, departure_airport: "JFK" } )
- D. db.flights.find( { airline_id: 2946863 } )
Answer: B,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 # 106
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: B
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/regex/
NEW QUESTION # 107
How to shutdown the server? (Mongo shell)
- A. use admin
- B. db.shutdown()
- C. use admin
- D. use admin
- E. db.shutdownServer()
- F. db.disconnect()
Answer: E
Explanation:
https://docs.mongodb.com/manual/reference/method/db.shutdownServer/
NEW QUESTION # 108
You have a developers collection with the following document structure: { _id: 1, fname: 'John', lname: 'Smith', tech_stack: ['sql', 'git', 'python', 'linux', 'django', 'aws'] }, { _id: 2, fname: 'Michael', lname: 'Doe', tech_stack: [ 'git', 'python', 'sqlite', 'linux', 'flask' ] } Which of the following queries will return only the first three elements of the array in the tech_stack field?
- A. db.developers.find( {}, { tech_stack: [0, 3] } )
- B. db.developers.find( { tech_stack: { $slice: [0, 3] } } )
- C. db.developers.find( {}, { tech_stack: [0, 1, 2] } )
- D. db.developers.find( {}, { tech_stack: { $slice: [0, 3] } } )
Answer: D
Explanation:
https://docs.mongodb.com/manual/reference/operator/update/slice/
NEW QUESTION # 109
......
C100DEV Exam Dumps For Certification Exam Preparation: https://www.lead2passexam.com/MongoDB/valid-C100DEV-exam-dumps.html
Online VALID C100DEV Exam Dumps File Instantly: https://drive.google.com/open?id=1-V3FseYAnqNdzt9fv-gGYI0Qxc7I3fQ1