Lab- Using $lookup

If i use lookup on air_alliance with air_routes, all the routes will go into the 3 document on air_alliance. I think the document is so big that my compass is lagging. Am I doing it right?
OR should i be using lookup on air_routes with air_alliance?

@ Clement_43126

Let me remind you of the key recommendation in Chapter 1: put your $match stage as early as possible in your pipeline to reduce the number of documents that you manipulate. Since you have 66985 documents in the air_routes collection, and 3 in air_alliances, you should be able to answer your own question.

1 Like

Noted. My match was wrong too as i was using only $in. The tip on using $regex from another thread helped.

@ Clement_43126

Good work. Glad you got it!