Open lurchpop opened 7 years ago
What's the reason Document can't have this method?
static upsert(query, update){ return this.findOne(query).then(doc=>{ return Object.assign(doc, update).save(); }); }
Why the findOneAndUpdate(.., .., {upsert:true}) garbage where the save hooks don't even get called?
findOneAndUpdate(.., .., {upsert:true})
save
What's the reason Document can't have this method?
Why the
findOneAndUpdate(.., .., {upsert:true})
garbage where thesave
hooks don't even get called?