In the homework:

Chapter 3: Core Aggregation - Combining Information

Lab - Using $lookup

Using this as a solution:

db.air_routes.aggregate([

{$match:{$or:[{airplane:{$eq:“380”}},

{airplane:{$eq:“747”}}]}},

{$lookup:{

from: “air_alliances”,

localField: “airline.name”,

foreignField: “airlines”,

as: “AlNm”

}},

{$match:{AlNm:{$elemMatch:{$exists:true}}}},

{$group:{_id:"$AlNm.name",AlCnt:{$sum:1}}}

])

I get an answer (maximum value for AlCnt), but I am told this is wrong. Why is that? I hope someone can’t point out my mistake?

Second and side question:

This homework has 3 possible answers and 3 trials.

Trying all possibilities without even thinking will inevitably lead to the solution. Am I missing something? (For example because my browser wouldn’t show it all?)