-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #6081
- Loading branch information
Showing
10 changed files
with
66 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ block content | |
}) | ||
:markdown | ||
Here we see that the query was executed immediately and the results passed to our callback. All callbacks in Mongoose use the pattern: | ||
`callback(error, result)`. If an error occurs executing the query, the `error` parameter will contain an error document, and `result` | ||
`callback(error, result)`. If an error occurs executing the query, the `error` parameter will contain an error document, and `result` | ||
will be null. If the query is successful, the `error` parameter will be null, and the `result` will be populated with the results of the query. | ||
.important | ||
:markdown | ||
|
@@ -77,24 +77,24 @@ block content | |
exec(callback); | ||
|
||
:markdown | ||
A full list of [Query helper functions can be found in the API docs](http://mongoosejs.com/docs/api.html#query-js). | ||
A full list of [Query helper functions can be found in the API docs](./api.html#query-js). | ||
|
||
h3#setters | ||
:markdown | ||
Setters are not executed by default in 4.x. For example, if you lowercase emails in your schema: | ||
|
||
:js | ||
var personSchema = new Schema({ | ||
email: { | ||
type: String, | ||
lowercase: true | ||
} | ||
}); | ||
|
||
:markdown | ||
Mongoose will **not** automatically lowercase the email in your queries, so `Person.find({ email: '[email protected]' })` would return no results. | ||
Use the `runSettersOnQuery` option to turn on this behavior: | ||
|
||
:js | ||
var personSchema = new Schema({ | ||
email: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.