Pre-Winter Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

Download Full Version C100DBA MongoDB Exam

Page: 7 / 13
Total 172 questions

MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+) Questions and Answers

Question 25

A MongoDB collection named users contains sample documents with fields including name, age, address, description, city, and occupation.

The administrator uses the following query to perform a collection scan:

db.users.find({ city: " New York " , occupation: " Software Engineer " })

What compound index will improve the performance of the query the MOST?

Options:

A.

db.users.createIndex({ city: 1, name: 1 })

B.

db.users.createIndex({ city: 1, occupation: 1 })

C.

db.users.createIndex({ occupation: 1, name: 1 })

D.

db.users.createIndex({ occupation: 1, city: 1 })

Question 26

Consider that our posts collection contains an array field called tags that contains tags that the user enters. {

Which of the following commands will find all the posts that have been tagged as tutorial.

Options:

A.

db.posts.find( { tags : [ " tutorial " ] } );

B.

db.posts.find( { $array : {tags: " tutorial " ) > );

C.

db.posts.find( { tags : " tutorial " } );

D.

db.posts.findInArray( { tags : " tutorial " > );

Question 27

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

Options:

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.

{ }

Question 28

Which node in a replica set does accept write operation?

Options:

A.

arbiter

B.

hidden

C.

primary

D.

secondary

Page: 7 / 13
Total 172 questions