release 2.8.0

232 views
Skip to first unread message

Aaron Heckmann

unread,
Aug 23, 2012, 12:44:41 PM8/23/12
to mongoo...@googlegroups.com
2.8.0 / 2012-08-23
==============

* changed; fixed; retain virtual setter return values #1069
* changed; fixed; directly setting nested objects now overwrites
instead of merging
* updated; driver to 1.1.4
* fixed; error on bad validators #1044
* fixed; query population edge case #1053 #1055
[jfremy](https://github.com/jfremy)


In previous 2.x releases return values of virtual setters were
discarded. In 2.8.0 the return values (if any) are passed on to the
next virtual setter to support value transforms. See
https://github.com/learnboost/mongoose/commit/cf8fe139cbb69908f7f8ef84aaa029df2ed78179

Previous 2.x releases directly setting a nested object caused the old
object and new objects to merge. In 2.8.0 the behavior has changed to
correctly mirror native javascript behavior by overwriting the old
object completely:

schema = Schema({ nested: { x: String, y: Number }})
var D = db.model('D', schema)
var d = new D({ nested: { y: 10 }})
console.log(d) // { nested: { y: 10 }}
d.nested = { x: 'overwritten' };
// < 2.8
console.log(d) // { nested: { y: 10, x: 'overwritten' }
// 2.8
console.log(d) // { nested: { x: 'overwritten' }}


The 2.x branch will continue to be maintained through the end of 2012
but we highly recommend moving to 3.x when practical.

As always, please report bugs on github:
https://github.com/learnboost/mongoose/issues


--
Aaron
@aaronheckmann
Reply all
Reply to author
Forward
0 new messages