November 2018
Beginner
132 pages
2h 57m
English
MongoDB, the NoSQL database, which is popular for being a part of the MEAN stack (MongoDB, Express, Angular, and Node.js), will be used to persist all of our contact data into our API. Its ability to easily save JSON objects without needing a strict schema setup is great for our purposes.
We will be making use of Mongoose, a popular ODM library, for all of our database interactions. Mongoose manages our interactions with the database, does object schema validation, and also maps objects in our code into their corresponding MongoDB document representations.
Let's update our index.js file, in order to allow our app to connect to the database with Mongoose, as follows:
// ./index.js// ...const mongoose = require('mongoose'); ...Read now
Unlock full access