What Is Mongoose?
mongoose is an object modeling package for Node that essentially works like an ORM that you would see in other languages (like Eloquent for Laravel).
Mongoose allows us to have access to the MongoDB commands for CRUD simply and easily. To use mongoose, make sure that you add it to you Node project by using the following command:
$ npm install mongoose --save
Now that we have the package, we just have to grab it in our project:
var mongoose = require('mongoose');
We also have to connect to a MongoDB database (either local or hosted):
mongoose.connect('mongodb://localhost/myappdatabase');
Let's get to the commands.

No comments:
Post a Comment