MongoDB and Node.js are often used together because of their shared use of Javascript and its Object Notation (JSON). Mongoose is a popular helper library that provides a more rigorous modeling environment for your data, enforcing a little bit more structure as needed, while still maintaining flexibility that makes MongoDB powerful. In this article, you make a connection to a hosted MongoDB instance at add-on provider MongoLab with Mongoose and model a simple object.
To deploy the app to Heroku you can use this one-click deploy link or follow these steps:
git clone git://github.com/mongolab/hello-mongoose.git && cd hello-mongoose
heroku create
heroku addons:add mongolab
git push heroku master
heroku open
MIT Licensed