Skip to content

Commit

Permalink
Update schematype.js
Browse files Browse the repository at this point in the history
Fixed documentation for returning a promise from a validator to match documentation at http://mongoosejs.com/docs/validation.html.
  • Loading branch information
Miles Barr committed Apr 18, 2017
1 parent 551c0a7 commit 7f6d459
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/schematype.js
Expand Up @@ -419,9 +419,8 @@ SchemaType.prototype.get = function(fn) {
*
* // Can also return a promise
* schema.path('name').validate({
* isAsync: true,
* validator: function (value, respond) {
* return new Promise(resolve => {
* validator: function (value) {
* return new Promise(function (resolve, reject) {
* resolve(false); // validation failed
* });
* }
Expand Down

0 comments on commit 7f6d459

Please sign in to comment.