Skip to Main Content
Node.js for Beginners
book

Node.js for Beginners

by Ulises Gascón
May 2024
Beginner to intermediate content levelBeginner to intermediate
382 pages
7h 59m
English
Packt Publishing
Content preview from Node.js for Beginners

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Node.js: Novice to Ninja

Node.js: Novice to Ninja

Craig Buckler
Node.js - The Complete Guide

Node.js - The Complete Guide

Academind by Maximilian Schwarzmüller GmbH
JavaScript from Beginner to Professional

JavaScript from Beginner to Professional

Rob Percival, Laurence Svekis, Maaike van Putten, Codestars By Rob Percival

Publisher Resources

ISBN: 9781803245171Supplemental Content