connect your heroku app to mongodb after hosting code example Example: mongodb add on heroku $ heroku addons:create mongolab:sandbox