M121 Chapter 3 Using $lookup

Hi, I have a problem with this lab. I have tried two ways but

The first one show the same number of routes in the all alliances. The pseudocode is:

  1. from air alliances collection
  2. lookup form air_routes with let airline because the join fileld is into a object
  3. pipeline matching air_allliance.airlines with the variable projecting the field airplane
  4. After this unwind the previous result
  5. Match airplanes 747 and 380
  6. group by air_alliance name

I don’t know what’s the problem in this first way.

The second one:
from air_routes
match airplanes in 747,380
groupby counting by airline.name
lookup from air_alliances, let with air_alliances.airlines in a variable
pipeline matching the id from group by (airline name) with the variable projecting the air_alliance

This solutions doesn’t run, it returns "Display all 185 possibilities? (y or n).

If I write y, it showme functions

What’s the problem in this solution?

Thx in advance

Possibly tabs or extra breaklines is causing this mismatch.

Suggest you write your code using a Text editor like Notepad++ and use consistent spaces instead of tabs.

PS: You might want to edit your post and link it to the course.

The was a bracket but I have more. “SyntaxError: missing ] after element list :”

Is there any way in order show you my code?

About “You might want to edit your post and link it to the course.” . How could I do? I should paste the lab link it he message/subject?


No private messaging between peers. Suggest you break down your code. Start stage by stage until you find the problem stage.

On your first post, click the pencil icon and you’ll see a dropdown box from which you can select the course.

Hi, I have no problems with the syntax but the server doesn’t return any result.
What can I do?.
With the first solution do you have any advice? Is it not well explained?

This is the only advice.
Start with the first stage, run it to see the result. Add another stage, run->check results. If any stage doesn’t return results then you know where the problem is.

I suspect that you are using a field or collection that doesn’t exist or your criteria is incorrect.

The key here is to break it down to debug.

1 Like

Hi @luisjmlky,

Please check your discourse inbox if the problem still persists.