CRUD 1 - Inserting and Finding Documents
In this unit, we learned how to insert and find documents in a collection with MongoDB. We also built queries with the following comparison operators:
$gt (Greater Than)
$lt (Less Than)
$lte ( Less Than or Equal To)
$gte (Greater Than or Equal To)
We also used the following logical operators:
$and
$or
Finally, we learned how to query elements in an array and how to use the $elemMatch operator.
Resources
Use the following resources to learn more about inserting and finding documents in MongoDB:
Lesson 1 - Inserting Documents
Lesson 2 - Finding Documents
Lesson 3 - Finding Documents Using Comparison Operators
Lesson 4 - Querying on Array Elements
Lesson 5 - Finding Documents Using Logical Operators
Associate Certification Course
Did you know that by completing this unit you've finished 30% of the CRUD content necessary for the Associate Developer Certification exam?
If you're interested in continuing, your next step would be:
- Unit 05 - CRUD 2
Video Transcript (English)
In this unit, you learned how to insert and find documents in a collection with MongoDB. You also learned how to build your own queries with different comparison operators, such as:
$gt (greater than)
$lt (less than)
$lte (less than or equal to)
$gte (greater than or equal to)
And logical operators, such as:
$and
$or
Operators give us more control over the results of our queries, which in turn makes our application easier to develop. Sometimes, the right operator will make your query more specific, more accurate, and more performant.
Finally, you learned how to query elements in an array and how to use the $elemMatch operator.
So, congratulations on completing this unit. Now you can successfully insert and find documents in a collection.
As a next step, you can explore additional tasks such as updating and deleting documents. This will allow you to perform all CRUD operations in MongoDB.
