
[Jan-2024] C100DEV Dumps are Available for Instant Access using ExamTorrent
C100DEV Dumps 2024 - New MongoDB C100DEV Exam Questions
NEW QUESTION # 136
Select all default configurations for mongod.
- A. By default, mongod is only bound to localhost (or 127.0.0.1).
- B. By default, mongod doesn't enforce authentication.
- C. The default data directory for mongod is /data/db
- D. The default port for mongod is 27017.
Answer: A,B,C,D
Explanation:
https://docs.mongodb.com/manual/reference/configuration-options/
NEW QUESTION # 137
Suppose we have database with the following collections: db.users.insertMany([ { _id: 1, user_name: 'karo243', account_id: 1010 }, { _id: 2, user_name: 'jano23', account_id: 3213 }, { _id: 3, user_name: 'fac_data', account_id: 4336 } ]) db.accounts.insertMany([ { account_id: 1010, type: 'investment', limit: 1000000 }, { account_id: 4336, type: 'derivatives', limit: 100000 } ]) We want to perform so-called left join. To the users collection join account details from accounts collection based on account_id field. See below. Expected output: [ { _id: 1, user_name: 'karo243', account_id: 1010, account_details: [ { _id: ObjectId("61af47c6e29861661d063714"), account_id: 1010, type: 'investment', limit: 1000000 } ] }, { _id: 2, user_name: 'jano23', account_id: 3213, account_details: [] }, { _id: 3, user_name: 'fac_data', account_id: 4336, account_details: [ { _id: ObjectId("61af47c6e29861661d063715"), account_id: 4336, type: 'derivatives', limit: 100000 } ] } ]
Which query do you need to use?
- A. db.users.aggregate([ { $lookup: { from: 'accounts', as: 'account_details' } } ])
- B. db.accounts.aggregate([ { $lookup: { from: 'accounts', localField: 'account_id', foreignField: 'account_id', as: 'account_details' } } ])
- C. db.users.aggregate([ { $lookup: { from: 'accounts', localField: 'account_id', foreignField: 'account_id', as: 'account_details' } } ])
- D. db.users.aggregate([ { $lookup: { from: 'accounts', localField: 'account_id', foreignField: 'account_id' } } ])
Answer: C
Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/
NEW QUESTION # 138
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 --config mongod.conf
- C. mongod --use mongod.conf
- D. mongod -f mongod.conf
Answer: B,D
Explanation:
https://docs.mongodb.com/manual/reference/configuration-options/#use-the-configuration-file
NEW QUESTION # 139
Which of the following methods executes a database command? (mongo shell)
- A. db.runThisCommand({ <command> })
- B. db.ommand({ <command> })
- C. db.runCommand({ <command> })
- D. db.execute({ <command> })
Answer: C
Explanation:
https://docs.mongodb.com/manual/reference/method/db.runCommand/
NEW QUESTION # 140
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. 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.
- B. Embed all the fields for a course as a subdocument in the corresponding instructor document.
- C. Embed the entities for the courses as an array of sub-documents in the corresponding instructor document.
Answer: A,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 # 141
Select the method that forces MongoDB to use a specific index.
- A. explain()
- B. force()
- C. index()
- D. hint()
Answer: D
Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.hint/
NEW QUESTION # 142
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 # 143
Select all true statements about data modeling in MongoDB.
- A. Unlike SQL databases, where the table schema must be specified and declared before inserting the data, MongoDB collections don't, by default, require documents to have the same schema.
- B. The field set and data type for each field can differ across documents within a collection.
- C. In MongoDB we can enforce document validation rules for a collection during update and insert operations.
- D. MongoDB can easily handle both unstructured and structured data sets.
Answer: A,B,C,D
Explanation:
https://docs.mongodb.com/manual/core/data-modeling-introduction/
NEW QUESTION # 144
What is the best practice in using the $match operator?
- A. The later in the pipeline, the better.
- B. The earlier in the pipeline, the better. Not only because we will be using expression filters which reduce the number of documents to be processed, but also because we can use indexes.
- C. It doesn't matter when we apply $match stage.
Answer: B
Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/match/
NEW QUESTION # 145
Which command do you use to display all indexes in routes collection?
- A. db.routes.indexes()
- B. db.routes.getIndexes()
- C. db.routes.dropIndex()
- D. db.routes.dropIndex()
Answer: B
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.getIndexes/
NEW QUESTION # 146
The greater the cardinality of a field, the...
- A. more useful an index created on this field will be.
- B. less useful an index created on this field will be.
Answer: A
NEW QUESTION # 147
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 operator should you use to extract all sales documents that have 'notepad' name in items field?
- A. $all
- B. $match
- C. $nin
- D. $elemMatch
- E. $in
Answer: D
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/elemMatch/
NEW QUESTION # 148
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 perform text search queries on fullplot field.
What do you have to do? Just query the database. For example:
- A. First, create a text index: db.movies.createIndex( { fullplot: 'text' } ) Then query the database: db.movies.find( { $text: { $search: 'spaceship' } } )
- B. Just query the database. For example: db.movies.find( { $text: { $search: 'spaceship'} } ).explain()
- C. First, create an index: db.movies.createIndex( { fullplot: 1 } )Then query the database: db.movies.find( { $text: { $search: 'spaceship' } } )
Answer: A
Explanation:
https://docs.mongodb.com/manual/text-search/ https://docs.mongodb.com/manual/core/index-text/
NEW QUESTION # 149
You have the following configuration file: storage: dbPath: /var/mongodb/db net: bindIp: localhost port: 27000 security: authorization: enabled You have to update this file such that: * mongod sends logs to /var/mongodb/logs/mongod.log * mongod is forked and run as a daemon Select correct Answer.
- A. storage: dbPath: /var/mongodb/db net: bindIp: localhost port: 27000 security: authorization: enabled systemLog: destination: file path: "/var/mongodb/logs/mongod.log"
- B. storage: dbPath: /var/mongodb/db net: bindIp: localhost port: 27000 security: authorization: enabled systemLog: destination: file path: "/var/mongodb/logs/mongod.log" processManagement: fork: true
- C. storage: dbPath: /var/mongodb/db net: bindIp: localhost port: 27000 security: authorization: enabled processManagement: fork: true
Answer: B
Explanation:
https://docs.mongodb.com/manual/reference/configuration-options/
NEW QUESTION # 150
Select all true statements regarding to replica sets in MongoDB.
- A. Replica sets use failover to provide high availability to client applications.
- B. We can have up to 50 replica set members, but only 7 of those will be voting members.
- C. Replica set members have a fixed role assigned.
Answer: A,B
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 # 151
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 extract all movies from this collection where genres does not include 'Romance'. Which query should we use?
- A. db.movies.find( { genres: { $and: ['Romance'] } } )
- B. db.movies.find( { genres: { $in: ['Romance'] } } )
- C. db.movies.find( { genres: { $or: ['Romance'] } } )
- D. db.movies.find( { genres: { $nin: ['Romance'] } } )
Answer: D
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/nin/
NEW QUESTION # 152
......
MongoDB C100DEV Exam Practice Test Questions: https://www.examtorrent.com/C100DEV-valid-vce-dumps.html
Free C100DEV Braindumps Download Updated: https://drive.google.com/open?id=1RdgPmMVkJuNjF9vWPkXb-l0hQaWZT6I3
