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 # 20 Topic 3 Discussion

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

C100DBA Exam Topic 3 Question 20 Discussion:
Question #: 20
Topic #: 3

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


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.