There are a few options for using MongoDB in your project. You could install MongoDB locally, or we can use an online database and connect to it using the URI string.

We'll be connecting to a database we create on mLab. Once you create an account, you can setup a free database and use the connection string that looks like this: mongodb://<user>:<pass>@localhost/<dbname>.

Install mongoose with:

Table of Contents

    npm install --save mongoose

    Then use it in your project by bringing it in:

    var mongoose = require('mongoose');

    And configuring it:


    Chris Sevilleja

    176 posts

    Founder of Google Developer Expert in Web Technologies. Slapping the keyboard until something good happens.