These are chat archives for Automattic/mongoose

3rd
Sep 2016
bucky0970
@bucky0970
Sep 03 2016 06:16
User.findOne({auth0id: req.user.id}, function(e,r){
r.creates[0].lampcase.push(instanceData);
r.save(function(err){
res.json("done")
});
});
why can't save the push result?
Vlado Tesanovic
@vladotesanovic
Sep 03 2016 09:28
@nacq If you use findAndModify there is flag new , result of operation will be updated document
nacq
@nacq
Sep 03 2016 14:37
@vladotesanovic thanks for the tip man, anyways don't you find Model.findAndModify to be too slow in comparison to Model.update?
Vlado Tesanovic
@vladotesanovic
Sep 03 2016 17:15
@nacq can you measure execution time?
@drGrove I am using your JSDoc swagger stuff, it works :+1:
Daniel Grove
@drGrove
Sep 03 2016 17:19
Awesome, thanks vladotesanovic. We're working on aligning a few things more closely to swagger spec, since we've recently added support for tags