Weekend Sale Special - 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: newyear

MongoDB C100DBA - MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+)

Page: 5 / 6
Total 172 questions

Consider the following document from the products collection:

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

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)

A collection and a document in MongoDB is equivalent to which of the SQL concepts respectively?

A.

Column and Row

B.

Table and Row

C.

Database and Table

D.

Table and Column

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 " }

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 " } })

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?

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

What command set removes node-1.cluster1.mycompany.local:27017 and node-2.cluster1.mycompany.local:27017 from the replica set, then adds node-1.cluster1.mycompany.local:27017 back to the replica set?

A.

rs.removeNode( " node-1.cluster1.mycompany.local:27017 " )rs.removeNode( " node-2.cluster1.mycompany.local:27017 " )rs.add({ host: " node-1.cluster1.mycompany.local:27017 " })

B.

rs.removeNode( " node-1.cluster1.mycompany.local:27017 " )rs.removeNode( " node-2.cluster1.mycompany.local:27017 " )rs.addNode({ host: " node-1.cluster1.mycompany.local:27017 " })

C.

rs.remove( " node-1.cluster1.mycompany.local:27017 " )rs.remove( " node-2.cluster1.mycompany.local:27017 " )rs.add({ host: " node-1.cluster1.mycompany.local:27017 " })

D.

rs.remove( " node-1.cluster1.mycompany.local:27017 " )rs.remove( " node-2.cluster1.mycompany.local:27017 " )rs.addNode({ host: " node-1.cluster1.mycompany.local:27017 " })

You have designed a web application with mongoDB. You have configured replication. The replica set is in place and function properly. What happens in case of failure?

A.

Switchover needs to be done manually

B.

Failover happens automatically

C.

Switchover happens automatically

D.

Failover needs to be done manually

An employees collection contains documents with fields such as _id, name, age, department, and salary.

A database administrator needs to run a query that will return ONLY the name and age fields for all employees.

Which query meets this requirement?

A.

db.employees.find({ name: 1, age: 1 }, { })

B.

db.employees.find({ name: 1, age: 1, _id: 0 }, { })

C.

db.employees.find({ }, { name: 1, age: 1, _id: 0 })

D.

db.employees.find({ }, { name: 1, age: 1 })

You have a replicated cluster with 1 primary, 3 secondary, 1 arbiter. One of the secondary is hidden. What is the replication factor of this replicated cluster?

A.

7

B.

03

C.

04

D.

06

What command adds a document to the class101 collection where the student is " Randall " and the student passed the class?

A.

db.class101.insertOne({ student: " Randall " , passed: True })

B.

db.class101.insertOne({ student: Randall, passed: true })

C.

db.class101.insertOne({ student: Randall, passed: True })

D.

db.class101.insertOne({ student: " Randall " , passed: true })

Which of the following are valid json documents? Select all that apply.

A.

{ " a " :l, " b " :{ " b " :l, " c " : " foo " , " d " : " bar " , " e " :[l,2,4]}}

B.

{ " city " : " New York " , " population " , 7999034, boros:{ " queens " , " manhattan " , " staten island " , " the bronx " , u " brooklyn " }}

C.

{ " name " : " Fred Flintstone " ; " occupation " : " Miner " ; " wife " : " Wilma " }

D.

{ }