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

MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+) C100DBA Question # 19 Topic 2 Discussion

MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+) C100DBA Question # 19 Topic 2 Discussion

C100DBA Exam Topic 2 Question 19 Discussion:
Question #: 19
Topic #: 2

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

C100DBA 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?


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


Get Premium C100DBA Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.