I am new to nodejs and mongodb. As you see below code, I am trying to connect mongodb by NodeJs but there is an
"undefined" error
Could anyone help me ?
var mongoose = require('mongoose');
mongoose.Promise = require('bluebird');
var mongodb = 'mongodb://localhost/yenidb';
mongoose.connect(mongodb,{useMongoClient: true},function(err,err){
if(err){
console.log("mongoose error:" + err.log);
}
else{
console.log("mongoose db connection status :" + mongodb)
}
})