From the course: MongoDB Essential Training
Unlock the full course today
Join today to access over 23,400 courses taught by industry experts.
findOne and find - MongoDB Tutorial
From the course: MongoDB Essential Training
findOne and find
- [Instructor] You've also already used the find commands, but also here, there are some options that we didn't cover that you should know about. To briefly recap, you can find a single document with the findOne command and you can optionally specify any fields to match on in a document that you pass in. And you can find many documents at once with a .find command. Let's look at the data that we imported into our MongoDB database in the beginning. Okay, to do this, we're going to have to switch database to our sample data database. Just to remind you, if you want to see what all of the databases in your MongoDB deployment look like, you can get that by typing in show dbs and that will return all of the databases that are in your deployment. All right, so we want to use the sample data database. Okay, now let's look at what collections are present. Cool. So we've got the inventory collection, the movies collection and…
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)
-
-
-
-