Question: $group on continent 1 . The aggregate method allows a $group - you must specify the _ id and you can use aggregating functions such

$group on continent
1.
The aggregate method allows a $group - you must specify the _id and you can use aggregating functions such as $sum $min $max $push
The sample code shows the total population of each continent.
Show the number of countries in each continent.
\table[[1.,db.world.aggregate({],[2,$group: {],[3,_id: 'Scontinent',],[4,res: {],[5,$sum: '$popu7ation'],[6,}],[7,}],[8,})]]
$group on continent 1 . The aggregate method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!