From the course: MongoDB Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

$expr

$expr

- [Instructor] Congratulations, if you've got this far, you now know most of the ways you can perform CRUD operations. If you need to perform more complex queries, you need to turn to aggregation pipelines, at least most of the time. And we'll discuss those in the next few videos. But, you may have noticed, I said most of the time, there is one call operator that can do things like comparing different document values. That's the $expr operator, and I'm going to show you how to use that one now. So, if you have been following along, you'll be in the blog database, so the first thing you'll want to do is switch back to the sample data database. And we are going to be using the movies collection. So, you know my favorite thing to do, first check out one document from that collection to remind us how that collection is structured. All right, so, in this example, I am going to look for ratings of movies. So let's first of…

Contents