Black Friday Reward - Upto 75% off - Ends in 0d 00h 00m 00s - Coupon code: CFsave75

Pass the MongoDB MongoDB Certified DBA Associate C100DBA Questions and answers with CertsForce

Viewing page 2 out of 6 pages
Viewing questions 11-20 out of questions
Questions # 11:

Which of the following does MongoDB use to provide High Scalability?

Options:

A.

Replication


B.

Write Concern


C.

Indexing


D.

Sharding


Expert Solution
Questions # 12:

Consider the following document from the products collection:

Question # 12

What does the following query using $elemMatch return? db.products.find( { product_code: " 345678 " }, { variations: { $elemMatch: { size: ^L^ } } } )

Options:

A.

Returns the complete document but retrieves only the size field from the array


B.

Returns the document but with only one element in the variations array (corresponding to size L)


C.

Returns the complete document since MongoDB does not support partial array retrieval


D.

Returns the complete document but retrieves only the size field from the array and also with only one element in the variations array (corresponding to size L)


Expert Solution
Questions # 13:

In a replica set with a primary and two secondaries, what should the write concern be set to so only a single node is required to acknowledge a write operation before it is deemed successful?

Options:

A.

{ writeConcern: { w: " 1 " } }


B.

{ writeConcern: 1 }


C.

{ writeConcern: " 1 " }


D.

{ writeConcern: { w: 1 } }


Expert Solution
Questions # 14:

Below is a sample document of " orders " collection

Question # 14

Options:

A.

$project


Expert Solution
Questions # 15:

What operation updates the value of the unitsInStock field to 25 for a document with a " laptop " product, and inserts a new document if it does not exist?

Options:

A.

db.inventory.updateOne({ product: " laptop " }, { $set: { unitsInStock: 25 } }, { upsert: true })


B.

db.inventory.insertOne({ product: " laptop " }, { $set: { unitsInStock: 25 } }, { upsert: true })


C.

db.inventory.insertOne({ product: " laptop " }, { $set: { unitsInStock: 25 } }, { upsert: True })


D.

db.inventory.updateOne({ product: " laptop " }, { $set: { unitsInStock: 25 } }, { upsert: True })


Expert Solution
Questions # 16:

Which of the following needs to be performed prior to initiate backup on a sharded cluster?

Options:

A.

db.stopBalancer( )


B.

sh.stopServer( )


C.

db.stopServer( )


D.

sh.stopBalancer( )


Expert Solution
Questions # 17:

What is the output of following two commands in MongoDB: db. posts. insert({n_id " :l}) db.posts.insert({ " _id " :l})

Options:

A.

Two documents will be inserted with _id as 1


B.

MongoDB will automatically increment the _id of the second document as 2


C.

This will throw a duplicate key error


D.

It will insert two documents and throw a warning to the user


Expert Solution
Questions # 18:

Given the following MongoDB document in the users collection:

{ " userid " : 1, " first " : " John " , " roles " : " Basic " }

Which statement results in this document?

{ " userid " : 1, " first " : " John " , " roles " : " SuperUser " }

Options:

A.

db.users.replaceOne({ userid: 1 }, { first: " John " , roles: " SuperUser " })


B.

db.users.replaceOne({ userid: 1 }, { userid: 1, first: " John " , roles: " SuperUser " })


C.

db.users.replaceOne({ userid: 1 }, { roles: " SuperUser " })


D.

db.users.replaceOne({ userid: 1 }, { $set: { roles: " SuperUser " } })


Expert Solution
Questions # 19:

Consider that the posts collection contains an array called ratings which contains ratings given to the post by various users in the following format:

Question # 19

Which of the following query will return all the documents where the ratings array contains elements that in some combination satisfy the query conditions?

Options:

A.

db.inventory.find( { ratings: { $elemMatch: { $gte: 3, $lte: 6 } } } )


B.

db.inventory.find( { ratings: { $elemMatch: { $gt: 3, $lt: 6 }


C.

db.inventory.find( { ratings: { ratings.$: { $gt: 5, $lt: 9 } } } )


D.

db.inventory.find( { ratings: { ratings: { $gt: 5, $lt: 9 } } } )


Expert Solution
Questions # 20:

Consider that you have a collection called population which has fields state and city. Which of the following query will calculate the population grouped by state and city?

Options:

A.

db.population.aggregate( [{ $group: { _id: { state: " $state " , city; " $city " },pop: { $sum: 1 > > > ] )


B.

db.population.aggregate( [{ $group: { _id: { state: Estate " , city: " $city " },pop: { $pop: 1 } } }] )


C.

db.population.aggregate( [{ $group: { _id: { state: Estate " , city: n$city " },pop: { $sum: " $pop " } } }] )


D.

db.population.aggregate( [{ $group: { _id: { city: " $city " },pop: { $sum: " $pop " } } }] )Multi Document Transaction is not supported by MongoDB


Expert Solution
Viewing page 2 out of 6 pages
Viewing questions 11-20 out of questions