M121 - 3rd chapter, lookup lab

Hi all,

i’m doing the “Using $lookup” lab. I think i got it right but rechecking the numbers don’t add up. I noticed that there are flight companies with the same name and as the alliances contain only the names of airlines is a problem when trying to match them…

Herer’s an example of two companies with the same name (i dont think this can give hints about the lab:

db.air_airlines.find({ name: "Eagle Aviation" })
[
  {
    _id: ObjectId("56e9b497732b6122f8790ab0"),
    airline: 2098,
    name: 'Eagle Aviation',
    alias: '',
    iata: 'GYP',
    icao: 'GYPSY',
    active: 'N',
    country: 'United Kingdom',
    base: 'KWM'
  },
  {
    _id: ObjectId("56e9b497732b6122f8790aaf"),
    airline: 2097,
    name: 'Eagle Aviation',
    alias: '',
    iata: 'EGU',
    icao: 'AFRICAN EAGLE',
    active: 'N',
    country: 'Uganda',
    base: 'FVM'
  }
]

Am I doing something wrong?

Thanks in advance!

1 Like

Hi @Frederik_Nosi,
As mentioned in the questions:

Which alliance from air_alliances flies the most routes with…

You need to $lookup from the air_alliances collection and NOT from the air_airlines collection.

I hope that helps.

If you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

1 Like

Thanks SourabhBagreacha