concept Mongoose in category angular

appears as: Mongoose, Mongoose
Getting MEAN with Mongo, Express, Angular, and Node.js 2ED

This is an excerpt from Manning's book Getting MEAN with Mongo, Express, Angular, and Node.js 2ED.

To this end, the company behind MongoDB created Mongoose. In the company’s words, Mongoose provides “elegant MongoDB object modeling for Node.js” (https://mongoosejs.com).

You’ll start by connecting your application to a database before using Mongoose to define schemas and models. When you’re happy with the structure, you can add some test data directly to the MongoDB database. The final step is making sure that access to the data store also works when pushed up to Heroku. Figure 5.2 shows the flow of these four steps.

Figure 5.3. Viewing the MongoDB database and using Mongoose inside Express to model the data and manage the connection to the database

5.1.1. Adding Mongoose to your application

Mongoose is available as an npm module. As you saw in chapter 3, the quickest and easiest way to install an npm module is through the command line. You can install Mongoose and add it to your list of dependencies in package.json with one command.

Express server listening on port 3000
Mongoose connected to mongodb://localhost/Loc8r
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage