iamshaunjp/node-crash-course

mongoose promise while connneciting.

Closed this issue · 1 comments

mongoose.connect(url)
.then(....)
This gives syntax error.
but I tried using callback in mongoose.connect like..
mongoose.connect(url,(err,db)=>{
if (err){console.log(err)}
else {console.log('success')} //this worked
}

Sorry. It's my mistake