Question: Countries beginning with... 1 0 . Group countries according to the first letter of the name. As shown. Only give U through to

Countries beginning with...
10.
Group countries according to the first letter of the name. As shown. Only give "U" through to "Z".
You will need to use the $substr function and the $push aggregate function.1* db.world.aggregate([2 v {$project: {3_id: '$name',4 startswith: {$substr: ['$name', 0,1]}5}}6 v {$match: {7_id: {$gte: 'U'}8}3}9{$sort: {_id: 1}}
Countries beginning with... 1 0 . Group countries

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!