-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
4.0 Release Notes
Valeri Karpov edited this page Jan 28, 2015
·
15 revisions
Mongoose 4.0 brings some exciting new functionality: schema validation in the browser, query middleware, validation on update, and promises for async operations. In addition to these improvements, there are a few backwards breaking changes to be aware of when you choose to upgrade. The 3.8 branch will continue to be maintained until August 1, 2015.
First, a note on versioning. As of 4.0, Mongoose will return to using semantic versioning rather than the even/odd versioning system that NodeJS and MongoDB use. The even/odd versioning caused a lot of confusion and made releases much larger than they had to be. Each Mongoose release after 4.0 will be considered production-ready, and there will be no more backwards-breaking changes until 5.0.
- #1349:
setProfiling()
was removed. - #1351: Document no longer inherits from
EventEmitter
. Documents still fulfill the NodeJS EventEmitter API through function wrappers, butDocument instanceof EventEmitter
is no longer true. This is to prevent users from accidentally clobbering EventEmitter internals by creating schema paths named "domain", "_events", etc. - #2306: If
options.cursor
is specified,aggregate.exec()
will return a cursor and ignore any callback. - #2380: "save" and "validate" may no longer be schema path names.
- #2552: Upgraded mongodb driver to 2.0.x. Mongoose is a wrapper layer on top of the MongoDB node driver. The mongodb driver recently released version 2.0, which includes numerous performance and usability improvements. The new driver, however, introduces a few changes that affect the way you use Mongoose:
- If you are connecting to a replica set, you must specify the
replicaSet
option in the connection string.
- If you are connecting to a replica set, you must specify the