In this lecture, we continued working with MongoDB and learned how to use Mongoose to manage data in our Node.js applications.
Topics covered:
MongoDB and Mongoose – what's the difference?
Connecting to MongoDB Atlas using Mongoose
Schemas and Models – defining the structure of our data
CRUD operations: Create, Read, Update and Delete
Data validation – checking that data is correct before saving it
Using .env to keep database credentials secure
What is validation?
Validation means checking that data follows certain rules before saving it to the database. For example, we can require a student's name, check an email address or make sure a student ID has the correct format.
Workshop: Practice MongoDB and Mongoose using the provided exercises.
Next topic: REST APIs – connecting our frontend to the backend and database.