Which of the following query will calculate the population grouped by state and city?

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

Answer: C

Latest C100DBA Dumps Valid Version with 132 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments