Skip to content

Instantly share code, notes, and snippets.

@nomanHasan
Created September 7, 2017 19:04
Show Gist options
  • Save nomanHasan/c123887089c50d73eafa41ae401955b8 to your computer and use it in GitHub Desktop.
Save nomanHasan/c123887089c50d73eafa41ae401955b8 to your computer and use it in GitHub Desktop.
Add Bluebird Support to Mongoose
var bluebird = require('bluebird')
/*
Other Codes
*/
var mongoose = require('mongoose')
mongoose.Promise = bluebird
mongoose.connect('mongodb://127.0.0.1:27017/todoapp', { useMongoClient: true})
.then(()=> { console.log(`Succesfully Connected to the
Mongodb Database at URL : mongodb://127.0.0.1:27017/todoapp`)})
.catch(()=> { console.log(`Error Connecting to the Mongodb
Database at URL : mongodb://127.0.0.1:27017/todoapp`)})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment