These are chat archives for Automattic/mongoose

Aug 2018
Andrey Gazhala
Aug 31 2018 08:12
Hello to all. I call findOneAndUpdate method but it return old document. How can I return updated document?
Aug 31 2018 09:16
@AndreyGazhala you need to pass the option { new: true } to findOneAndUpdate(cond, update, options) in the options parameter.
Andrey Gazhala
Aug 31 2018 09:37
@lineus Thank you a lot!
Aug 31 2018 09:47
anytime @AndreyGazhala :smile:
Aug 31 2018 15:46
@lineus thanks. In my above case, I had a typo in some related code which was yielding invalid ID input values
Sean Lavine
Aug 31 2018 20:52
does mongoose do something special if you call push() on a Document array?
… like if you do mydoc.arr.push() vs mydoc.arr = [v1, v2] does it use $push vs $set?