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
var mydb;
var uri = 'mongodb://localhost/user1';
var promise = mongooose.connect(uri,{
useMongoClient: true,
});
promise.openUri(uri,function(errr,db){
if(errr){
throw errr;
}else{
console.log("Connection Successfull");
mydb = db;
}
});
One needs to have connection with the help of promise in the latest version of mongoose [this is the link][1] [1]: http://mongoosejs.com/docs/promises.html