These are chat archives for Automattic/mongoose

24th
Jan 2017
Lorenzo Gamboa García
@Lorengamboa
Jan 24 2017 08:13
when should I use methods and when statics
nacq
@nacq
Jan 24 2017 16:49
Should the value of 'this' on a pre save hook be the document before it changes?
Tom Speak
@tomspeak
Jan 24 2017 17:04
Hi, I have a working findOneAndUpdate call to update an object nested inside of an array: https://gist.github.com/tomspeak/93e02db60f90e69d645738048ec2620b — my question is, is it safe to search for choiceId — are these always guaranteed to be unique? I am failing on Google to see if choice[index]._id has a collection wide uniqueness. If not, can you point me in the direction on how best to update first by _id then choice[index]._id. Thanks