
[Jun-2023] Pass MongoDB C100DEV Exam in First Attempt Guaranteed!
Full C100DEV Practice Test and 253 unique questions with explanations waiting just for you, get it now!
NEW QUESTION # 53
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: { $slice: [0, 3] } } )
- B. db.developers.find( {}, { tech_stack: [0, 1, 2] } )
- C. db.developers.find( {}, { tech_stack: [0, 3] } )
- D. db.developers.find( {}, { tech_stack: { $slice: [0, 3] } } )
Answer: D
Explanation:
https://docs.mongodb.com/manual/reference/operator/update/slice/
NEW QUESTION # 54
What is MongoDB Charts?
- A. A feature that displays data about the performance of your Atlas cluster.
- B. MongoDB product that helps you visualize data stored in an Atlas cluster.
- C. An application that allows you to embed on your website visualizations that are created in other applications.
Answer: B
Explanation:
https://docs.mongodb.com/charts/
NEW QUESTION # 55
Suppose you are connected to mongod instance that is already running on port 27000 as admin user. You have to export reviews collection from the restaurants database to JSON file named reviews.json. Which command should you use?
- A. mongoexport --db restaurants --collection reviews -o reviews.json
- B. mongoexport --db restaurants --collection reviews -o export.json
- C. mongodump --db restaurants --collection reviews -o reviews.json
Answer: A
Explanation:
https://docs.mongodb.com/database-tools/mongoexport/
NEW QUESTION # 56
Select all true statements regarding to pipelines and the Aggregation Framework.
- A. An aggregation pipeline is an array of stages.
- B. An aggregation pipeline consists of one or more stages that process documents.
- C. The aggregation pipeline cannot operate on a sharded collection.
- D. The Aggregation Framework provides us many stages to filter and transform data.
- E. Aggregation Framework does not have the group stage for grouping data.
Answer: A,B,D
Explanation:
https://docs.mongodb.com/manual/aggregation/
NEW QUESTION # 57
Which cursor method should you use to return the number of documents in the result set?
- A. cursor.count()
- B. cursor.explain()
- C. cursor.sum()
- D. cursor.total()
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.count/
NEW QUESTION # 58
Assign typical operational tasks to the Mongo Developer.
- A. read data
- B. write data, read data
- C. create user, create index
Answer: B
NEW QUESTION # 59
Select all true statements regarding to unique indexes in MongoDB.
- A. db.products.createIndex( { manufacturer_id: 1 }, { unique: true } )
- B. When creating a unique index, we need to pass an additional unique option set to true. For example:
- C. In MongoDB we cannot enforce a unique constraint on compound indexes.
- D. A unique index ensures that the indexed fields don't store duplicate values.
- E. By default, MongoDB creates a unique index on the _id field.
Answer: A,D,E
Explanation:
https://docs.mongodb.com/manual/core/index-unique/
NEW QUESTION # 60
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: E
Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/
NEW QUESTION # 61
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: { $nin: ['Drama'] }, 'imdb.votes': { $gte: 100 } } }, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 } }, { $sort: { 'imdb.votes': -1 } }]
- B. [{ $match: { genres: { $nin: ['Drama'] }, 'imdb.votes': { $gte: 100 } } }, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 } }, { $sort: { 'imdb.votes': -1 } }, { $limit: 5 }]
- C. [{ $match: { genres: { $in: ['Drama'] }, 'imdb.votes': { $gte: 100 } } }, { $project: { _id: 0, title: 1, genres: 1, 'imdb.votes': 1 } }, { $sort: { 'imdb.votes': -1 } }, { $limit: 5 }]
Answer: B
Explanation:
https://docs.mongodb.com/manual/aggregation/
NEW QUESTION # 62
Given a companies collection where each document has the following structure: { _id: ObjectId("52cdef7c4bab8bd675297efd"), name: 'ZoomInfo', homepage_url: 'http://www.zoominfo.com', blog_url: 'http://zoominfoblogger.wordpress.com/', twitter_username: 'ZoomInfo', founded_year: 2000, email_address: '' } Extract all companies from this collection that have the same Twitter username as the company name. Which query should you use?
- A. db.companies.find( { $expr: { $ne: ['$name', '$twitter_username'] } } )
- B. db.companies.find( { $expr: { $eq: ['$name', '$twitter_username'] } } )
- C. db.companies.find( { $expr: { $eq: ['name', 'twitter_username'] } } )
- D. db.companies.find( { $expr: { $eq: ['$name', 'twitter_username'] } } )
Answer: B
Explanation:
db.companies.find( { $expr: { $eq: ['$name', 'twitter_username'] } } ) You have to use $ sign to evaluate twitter_username field. db.companies.find( { $expr: { $eq: ['name', 'twitter_username'] } } ) You have to use $ sign to evaluate name and twitter_username fields. https://docs.mongodb.com/manual/reference/operator/query/expr/
NEW QUESTION # 63
To ensure high availability in the event of a server failure, which of the following MongoDB features should you use?
- A. Properly defined indexes.
- B. Properly defined views.
- C. Proper storage engine.
- D. Sharding.
- E. Replication.
Answer: E
Explanation:
https://docs.mongodb.com/manual/replication/#replication
NEW QUESTION # 64
Select true statements about shard keys.
- A. All shard keys must be supported by an index with the same document fields.
- B. Shard keys can include the _id field, but they don't have to.
- C. Shard keys are used to organize documents into chunks and shards, and mongos can use this to route queries.
Answer: A,B,C
Explanation:
https://docs.mongodb.com/manual/core/sharding-shard-key/
NEW QUESTION # 65
There are some special databases in MongoDB that we cannot use to create a new database. Select those names.
- A. users
- B. config
- C. apps
- D. admin
- E. local
Answer: B,D,E
Explanation:
https://docs.mongodb.com/manual/reference/local-database/ https://docs.mongodb.com/manual/tutorial/manage-users-and-roles/ https://docs.mongodb.com/manual/reference/config-database/
NEW QUESTION # 66
Which cursor method should you use to get information about the query plan?
- A. cursor.map()
- B. cursor.hint()
- C. cursor.explain()
Answer: C
Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.explain/
NEW QUESTION # 67
Select true statements about capped collections.
- A. Capped collections guarantee preservation of the insertion order.
- B. Capped collections are fixed-size collections.
- C. Capped collections automatically remove the oldest documents in the collection to make room for new documents.
- D. If the collection is full, the oldest document in the collection is removed when a new document is added to the collection.
Answer: A,B,C,D
Explanation:
https://docs.mongodb.com/manual/core/capped-collections/
NEW QUESTION # 68
How does the document relate to the collection in MongoDB? Check all that apply.
- A. Collections consists of one or many documents.
- B. Collections are tables of documents.
- C. Documents are organized into collections.
- D. Documents consist of collections.
Answer: A,C
Explanation:
Explanation: https://docs.mongodb.com/manual/core/databases-and-collections/
NEW QUESTION # 69
How to connect to MongoDB with mongod to localhost running on port 27017?
- A. mongo --host 127.0.0.1:27017
- B. mongo --host 127.0.0.1:27000
- C. mongoconnect --host 127.0.0.1:27017
Answer: A
Explanation:
https://docs.mongodb.com/v4.4/mongo/#mongodb-instance-on-a-remote-host
NEW QUESTION # 70
Select all true statements about covered queries.
- A. All fields used in a query filter must be in the index used by the query.
- B. All fields returned in the result must be in the index used by the query.
- C. For a covered query, you service the operation entirely from the index, which is usually faster than checking each document.
- D. Covered queries don't use indexes.
Answer: A,B,C
Explanation:
https://docs.mongodb.com/manual/core/query-optimization/#covered-query
NEW QUESTION # 71
In your database there is a collection named trips with the following document structure: { '_id': ObjectId("572bb8222b288919b68abf6d"), 'trip_duration': 858, 'start_station id': 532, 'end_station_id': 401, 'bike_id': 17057, 'start_station_location': { type: 'Point', coordinates: [ -73.960876, 40.710451 ] }, 'end_station_location': { type: 'Point', coordinates: [ -73.98997825, 40.72019576 ] }, 'start_time': ISODate("2016-01-01T00:09:31.000Z"), 'stop_time': ISODate("2016-01-01T00:23:49.000Z") } How can you extract all trips from this collection ended at stations that are to the west of the -73.5 longitude coordinate?
- A. db.trips.find( { 'coordinates': { $lt: -73.5 } } )
- B. db.trips.find( { 'end_station_location.coordinates.0': { $gt: -73.5 } } )
- C. db.trips.find( { 'end_station_location.coordinates.0': { $lt: -73.5 } } )
- D. db.trips.find( { 'end_station_location.coordinates.1': { $lt: -73.5 } } )
Answer: C
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/lt/
NEW QUESTION # 72
......
Get Latest C100DEV Dumps Exam Questions in here: https://passguide.braindumpsit.com/C100DEV-latest-dumps.html