Summary
In this chapter, we learned how MongoDB is different from other databases. We learned how to install MongoDB locally using containers, with Docker and Docker Compose.
Additionally, we explored how we can manage sensitive information in our application using environment variables and the dotenv
package. We also learned how to use Mongoose to interact with MongoDB.
Finally, we migrated our application to use MongoDB instead of a JSON file. This gave us the opportunity to properly learn how to refactor and reorganize our previous code. This migration also made it easy to maintain and deploy the application, as data is stored and queried as an external source. This will help us to scale a lot in the future, as we can connect multiple replicas of our backend to the same database instance. We also learned how to test our application using MongoDB, and we used this testing approach to ensure that the migration was completed successfully.
In the next chapter, we will introduce...