I\'m trying to develop a class on the top of the mongoose with my custom methods, so I extended the mongoose with my own class but when I invoke to create a new car method i
I think you have your answer but I use global.promise with error handling
// MongoDB connection
mongoose.Promise = global.Promise;
var promise = mongoose.connect('mongodb://localhost:27017/test_db', {
useMongoClient: true,
});
promise.then(function(db) {
console.log("Connected to database!!!");
}, function(err){
console.log("Error in connecting database " + err);
});