Now, it is time we learn about lookup, a powerful stage that lets you combine information from two collections. For those with some knowledge of SQL, lookup is effectively a left outer join. If that did not make any sense, don't worry, let's break it down. In database terms, a left outer join combines all documents or entries on the left with matching documents or entries from the right. So A, left outer join with B, would look like this. The lookup stage has this form. The from field, here, is the collection from which we want to lookup documents, keep in mind that the collection you specify in the from field cannot be shortened and must exist within the same database. LocalField, here, is a field in the working collection where we express aggregation command that we want to compare to. ForeignField, here, is a field we want to compare from in the collection we specified in from, lookup will perform a strict equality comparison and the as field, here, is a new field name we specify that will show up in our documents that contains any matches between localField and foreignField. All matches were put in an array in this field. If there were no matches, the field will contain an empty array. Let's visualize this in an example, suppose we are aggregating over an airline's collection and we want to fetch which alliance the airline belongs to. As the argument from would specify air alliances. Next, we will specify name as the argument to local field, the value we want to compare to. The argument to local field can resolve to either in array or a single value. Then, we will specify airlines as argument to foreignField, the value we want to compare from. The argument foreignField can also resolve to either an array or a single value. We can see that based on the argument so far, Penguin Air won't match anything. Delta Airlines will match Sky Team and Lufthansa will match Star Alliance. Those matches broaden the current document as alliance. We could have given any string value we wanted, but keep in mind that if we specify a name that already exists in the working document that field will be overwritten. Notice here that because the document with named Penguin Air did not have any results, there is an empty array. Oftentimes, you have to relookup what to follow with a matched stage to filter documents out. Another thing to know, lookup retrieves the entire document that matched, not just the field which specified the foreignField. Alright, let's look at lookup in actual use. Let's combine information from the airlines collection with the Air Alliance's collection, putting all the airline information within the alliance document. First, let's look at the schema in our Air Alliance's collection. Okay, the data we need for local field is in the airlines field. Let's look at the airlines schema so we know what value to use as the foreignField. Alright, easy enough, it looks like the information we need for foreignField is in the name field, that should be all the information we need. Let's build the pipeline. Alright, we will specify air airlines to the from field, airlines as the local field, name is the foreignField. And here, we chose to override the airlines field with the information we get back. It makes sense, we will be replacing the names with entire documents. Let's see the output. Pretty cool. We can see that look up did just what we expected it to do. We could follow this with some projections or even another look up stage to perform some powerful reshaping analysis. But for now, that is enough. We have covered a lot of information in this lesson. Lookup is a powerful stage that can help reduce network requests and combine information from different collections together for powerful and deep analysis. Here are a few things to keep in mind. The from field cannot be shortened, the from collection must be in the same database, the values in localField and foreignField are matched on equality, and as can be any name but if it exists in the working document that field will be overwritten.