
Get Ready to Pass the C100DEV exam Right Now Using Our MongoDB Certified Developer Associate Exam Package
Enhance Your Career With Available Preparation Guide for C100DEV Exam
NEW QUESTION # 86
Which cursor method should you use to return the number of documents in the result set?
- A. cursor.count()
- B. cursor.sum()
- C. cursor.total()
- D. cursor.explain()
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.count/
NEW QUESTION # 87
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' }, total_score_with_bonus: { $add: ['$total_score', '$bonus'] } } }])
- B. db.players.aggregate([{ $addFields: { total_score: { $sum: '$scores' }, avg_score: { $avg: '$scores' } } }, { $addFields: { total_score_with_bonus: { $add: ['$total_score', '$bonus'] } } }])
Answer: B
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/ https://docs.mongodb.com/manual/reference/operator/aggregation/addFields/
NEW QUESTION # 88
Select all true statements about differences between using aggregate() and find() methods?
- A. Any find() query can be translated into an aggregation pipeline.
- B. aggregate() allows us to compute and reshape data in the cursor (like $group, $min and other stages).
- C. Any aggregation pipeline can be translated into a find() query.
- D. find() allows us to compute and reshape data in the cursor.
Answer: A,B
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.find/ https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/
NEW QUESTION # 89
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. mongodump --db restaurants --collection reviews -o reviews.json
- C. mongoexport --db restaurants --collection reviews -o export.json
Answer: A
Explanation:
https://docs.mongodb.com/database-tools/mongoexport/
NEW QUESTION # 90
Select true statements about the selection of the shard key.
- A. Non-monotonic data is a good choice for shard key.
- B. Monotonically changing shard keys result in write operations going to a single shard. This is inefficient.
- C. High frequency - most documents fall within a particular range. This can lead to bottleneck problems within the cluster.
- D. High cardinality provides more shard key values, which determines the maximum number of chunks the balancer can create.
Answer: A,B,C,D
Explanation:
https://docs.mongodb.com/manual/core/sharding-shard-key/
NEW QUESTION # 91
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" } ).sort( { "imdb.rating": 1, "imdb.votes": 1 } )
- A. No
- B. Yes
Answer: A
Explanation:
Yes, this query matches the equality in the query predicate with the index prefix and continues the prefix in the sort predicate moving the index backwards.
https://docs.mongodb.com/manual/indexes/
NEW QUESTION # 92
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' ] } Which of the following queries will find all movies that do not contain the Comedy and Romance genres?
- A. db.movies.find( { genres: { $nin: ["Comedy", "Romance"] } } )
- B. db.movies.find( { genres: { $or: ["Comedy", "Romance"] } } )
- C. db.movies.find( { genres: { $in: ["Comedy", "Romance"] } } )
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/nin/
NEW QUESTION # 93
What does it command do in the mongo shell?
- A. Terminates the current query execution.
- B. Iterates through the cursor results.
- C. Displays cluster statistics.
- D. it is not a mongo shell command.
Answer: B
NEW QUESTION # 94
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: 27100
security:
authorization: disabled - C. net:
port: 27000
processManagement:
fork: true
Answer: A
Explanation:
https://docs.mongodb.com/manual/reference/configuration-options/
NEW QUESTION # 95
Select all true statements about auto bucketing feature in Aggregation Framework. ($bucketAuto stage)
- A. This stage distributes documents evenly across predefined number of buckets.
- B. The granularity option allows us to specify preferred bucket boundaries.
- C. The syntax for this stage is as follows:
Answer: A,B,C
Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/bucketAuto/
NEW QUESTION # 96
Select all true statements regarding to $out stage.
- A. All indexes on an existing collection are rebuilt when $out overwrites the collection.
- B. $out operator will create a new empty collection or overwrite an existing collection if the pipeline raises an error.
- C. $out operator creates collections in the same database as the source collection.
- D. $out operator must be the last stage in a pipeline.
- E. $out operator will overwrite an existing collection if specified.
Answer: A,C,D,E
Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/out/
NEW QUESTION # 97
There are some special databases in MongoDB that we cannot use to create a new database. Select those names.
- A. config
- B. admin
- C. apps
- D. local
- E. users
Answer: A,B,D
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 # 98
Select all true statements about chunks in MongoDB.
- A. The cluster may split chunks once they become too big.
- B. Chunk ranges have an inclusive minimum and an exclusive maximum.
- C. Documents in the same chunk may store on different shards
Answer: A,B
Explanation:
https://docs.mongodb.com/manual/core/sharding-data-partitioning/
NEW QUESTION # 99
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 # 100
Select all true statements about elections (replica set).
- A. Nodes with a higher priority are more likely to be selected as primary node.
- B. Setting a node's priority to 0 ensures that a node never becomes primary.
- C. Elections can take place anytime while the primary is available.
- D. Not all nodes have equal chances to become the primary node.
Answer: A,B,D
Explanation:
https://docs.mongodb.com/manual/replication/#replication-in-mongodb
NEW QUESTION # 101
......
Get Special Discount Offer of C100DEV Certification Exam Sample Questions and Answers: https://www.pass4surecert.com/MongoDB/C100DEV-practice-exam-dumps.html
New C100DEV Dumps For Preparing MongoDB Certified Developer Associate Certified MongoDB Exam Well: https://drive.google.com/open?id=1Si1BK9ze7C1tpElzxQScKNBNXTLY7XQ6