12

Data Persistence with MongoDB

In this chapter, we will explain how MongoDB works and why it is a great starting point for a web application. We will learn how to install MongoDB locally using containers with Docker and Docker Compose and also how to use external MongoDB instances.

We will explore how to use Mongoose to interact with MongoDB, and we will migrate our application to use MongoDB instead of a JSON file, we will use tests to grant that the migration was properly done and we didn’t introduce any regression.

In summary, here are the main topics that we will explore in this chapter:

  • How to set up MongoDB locally using containers with Docker and Docker Compose
  • How to use an Object–relational mapping (ORM) library such as Mongoose ...

Get Node.js for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.