Created
September 7, 2017 19:04
-
-
Save nomanHasan/c123887089c50d73eafa41ae401955b8 to your computer and use it in GitHub Desktop.
Add Bluebird Support to Mongoose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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