These are chat archives for LearnBoost/mongoose

Mar 2015
Mar 11 2015 08:41
@vkarpov15 what is the difference between toObject and toJSON, I mean what are correct use cases for each? it seems both resuslt in plain object.
Jalal Albasri
Mar 11 2015 17:05
hey guys, i ran npm update and am now getting a warning about mongoose being unstable. What version should i specify in package.json to get stable version?
Valeri Karpov
Mar 11 2015 17:43
@whitecolor the reason why toJSON() exists as a separate function is that toJSON() is the first function JavaScript looks for when converting an object for JSON.stringify(), see the ECMAScript 5 spec section 15.12.3: . toObject() is usually the right choice unless you want to tweak what you get when you call JSON.stringify(doc)
@CavemanNinja 3.8.24 is latest stable, 4.0.0-rc3 is latest unstable
Mar 11 2015 22:31
@vkarpov15 findOneAndUpdate in 4rc3 works incorrectly (it updates, but callback result is not updated version of document). Have you seen this?