These are chat archives for LearnBoost/mongoose

11th
Mar 2015
Alex
@whitecolor
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
@JalalAlbasri
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
@vkarpov15
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: http://www.ecma-international.org/ecma-262/5.1/#sec-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
Alex
@whitecolor
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?