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 # 32 Topic 4 Discussion

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

C100DBA Exam Topic 4 Question 32 Discussion:
Question #: 32
Topic #: 4

Consider a products collection:

{ " _id " : 1, " item " : " t-shirt " , " color " : " red " , " price " : 10 }

{ " _id " : 2, " item " : " sweater " , " color " : " green " , " price " : 20 }

{ " _id " : 3, " item " : " belt " , " color " : " black " , " price " : 15 }

{ " _id " : 4, " item " : " hat " , " color " : " green " , " price " : 12 }

What operation modifies the price of all products that have a color value of " green " ?


A.

db.products.update({ " color " : " green " }, { " price " : { " $inc " : 5 } })


B.

db.products.update({ " color " : " green " }, { $inc: { " price " : 5 } })


C.

db.products.updateMany({ " color " : " green " }, { " $inc " : { " price " : 5 } })


D.

db.products.updateMany({ " color " : " green " }, { " price " : { " $inc " : 5 } })


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.