findOneAndUpdate的用法详解

时间:2016-02-26 12:03:55   收藏:0   阅读:924
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     });

 

原文:http://www.cnblogs.com/suoking/p/5219733.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!