From the course: MongoDB Essential Training
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
$expr - MongoDB Tutorial
From the course: MongoDB Essential Training
$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
-
-
-
-
-
-
(Locked)
insertOne and insertMany4m 58s
-
(Locked)
findOne and find7m 49s
-
(Locked)
Comparison operators6m 11s
-
(Locked)
Logical operators7m 55s
-
(Locked)
Sort, skip, limit4m 8s
-
(Locked)
updateOne and updateMany4m 36s
-
(Locked)
Arrays10m 2s
-
(Locked)
Transactions5m 2s
-
(Locked)
$expr5m 28s
-
(Locked)
Challenge: Create app1m 22s
-
(Locked)
Solution: Create app6m
-
(Locked)
-
-
-
-