GET 75% Discount on All Products Coupon code: "certbig75"
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?
db.population.aggregate( [{ $group: { _id: { state: " $state " , city; " $city " },pop: { $sum: 1 > > > ] )
db.population.aggregate( [{ $group: { _id: { state: Estate " , city: " $city " },pop: { $pop: 1 } } }] )
db.population.aggregate( [{ $group: { _id: { state: Estate " , city: n$city " },pop: { $sum: " $pop " } } }] )
db.population.aggregate( [{ $group: { _id: { city: " $city " },pop: { $sum: " $pop " } } }] )Multi Document Transaction is not supported by MongoDB
TESTED 05 Oct 2026