From the course: MongoDB Aggregation Pipeline: Advanced Data Analysis and Manipulation

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Joins in MongoDB with $lookup

Joins in MongoDB with $lookup

- [Instructor] One of the most powerful things about relational databases is their ability to join different tables together to get a more complete picture of the data within. One of the major drawbacks of NoSQL databases like MongoDB is that they do not support joins or so we thought, MongoDB does have the ability to do a type of join called a left outer join between two different collections using the $lookup aggregator. The best part about using $lookup operator in an aggregation is that you do not need to change your data model or explicitly define relationships between your data. If you have the right reference between two collections you can perform a join or $lookup in MongoDB and that is exactly what we're going to do in this video. To get started, let's open up the vendor's collection and look at a few documents in it. The vendor's collection holds information on vendors that manufacture our products. A single vendor…

Contents