skip to Main Content

Mongodb – mongoose code showing error of a call ack function

app.post ('/create_contact',function(req,res) { contact.create({ name :req.body.name, phone:req.body.phone },function(err,newContact) { if(err){console.log('error in creating a contact!'); return;} console.log('********',newContact); return res.redirect('back'); }); }); Errors: throw new MongooseError('Model.create() no longer accepts a callback'); ^ MongooseError: Model.create() no longer accepts a callback I tried this…

VIEW QUESTION
Back To Top
Search