Session Ready
Exercise

Countries of birth by prize category

Some prize categories have laureates hailing from a greater number of countries than do other categories. You will build an aggregation pipeline for the prizes collection to collect these numbers, using a $lookup stage to obtain laureate countries of birth.

Instructions
100 XP
  • $unwind the laureates array field to output one pipeline document for each array element.
  • After pulling in laureate bios with a $lookup stage, unwind the new laureate_bios array field (each laureate has only a single biography document).
  • Collect the set of bornCountries associated with each prize category.
  • Project out the size of each category's set of bornCountries.