这就是我的mongo数据库中的内容:这是我的app.post来插入数据,当我提交它时,console.log对象有日期,但是使用create它只表示"null“->。App listening on port 4000null { _id: new ObjectId("6274a7a58d8946ca10ae57c4"), __v:
new contacts.quickContactquickContact.initials = req.body.initials为了避免任何空值字段,我使用以下代码
var quickContact = new contacts.quickContactquickContact.initials = req.body
在下面的中间件片段中,我需要从req.body中删除换行符,以便为在JSONP响应中发送做准备。server.use(function(req,res,next){ req.body = req.body; // <--- HERE I needto remove the newlines, etc. req.body = req.body || {};
req.body.jsonp_