Skip to content

Commit

Permalink
docs; make a note re: #2955 in migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jun 7, 2015
1 parent 1bcb8ce commit 5efafb1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/migration.jade
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ block content
:markdown
In Mongoose 3, CastError and ValidationError had a `type` field. For instance, user defined validation errors would have a `type` property that contained the string 'user defined'. In Mongoose 4, this property has been renamed to `kind` due to [the V8 JavaScript engine using the Error.type property internally](https://code.google.com/p/v8/issues/detail?id=2397).

h3#promises Query now has a `.then()` function
:markdown
In mongoose 3, you needed to call `.exec()` on a query chain to get a promise back, like `MyModel.find().exec().then();`. Mongoose 4 queries are promises, so you can do `MyModel.find().then()` instead. Be careful if you're using functions like [q's `Q.ninvoke()`](https://github.com/kriskowal/q#adapting-node) or otherwise returning a mongoose query from a promise.

h3#moreinfo More Info
:markdown
Related blog posts:
Expand Down

0 comments on commit 5efafb1

Please sign in to comment.