1 Fragment.findOneAndUpdate({_id:id}, {$set: datas}, {upsert:true, 'new':true}).populate('ads').exec(function(err, item) { 2 es.render('fragments/edit', {item:item, current: req.user, message:'保存成功'}); 3 res.json(item); 4 });
1 Fragment.findOneAndUpdate({_id:id}, {$set: datas}, {upsert:true, 'new':true}).populate('ads').exec(function(err, item) { 2 es.render('fragments/edit', {item:item, current: req.user, message:'保存成功'}); 3 res.json(item); 4 });