You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/validation.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -34,8 +34,8 @@ Before we get into the specifics of validation syntax, please keep the following
34
34
Mongoose has several built-in validators.
35
35
36
36
- All [SchemaTypes](schematypes.html) have the built-in [required](api/schematype.html#schematype_SchemaType-required) validator. The required validator uses the [SchemaType's `checkRequired()` function](api/schematype.html#schematype_SchemaType-checkRequired) to determine if the value satisfies the required validator.
37
-
-[Numbers](api/schema-number-js.html#schema-number-js) have [`min` and `max`](schematypes.html#number-validators) validators.
38
-
-[Strings](api/schema-string-js.html#schema-string-js) have [`enum`, `match`, `minLength`, and `maxLength`](schematypes.html#string-validators) validators.
37
+
-[Numbers](schematypes.html#numbers) have [`min` and `max`](schematypes.html#number-validators) validators.
38
+
-[Strings](schematypes.html#strings) have [`enum`, `match`, `minLength`, and `maxLength`](schematypes.html#string-validators) validators.
39
39
40
40
Each of the validator links above provide more information about how to enable them and customize their error messages.
41
41
@@ -96,7 +96,7 @@ the value `false`, Mongoose will consider that a validation error.
96
96
97
97
Errors returned after failed validation contain an `errors` object
98
98
whose values are `ValidatorError` objects. Each
99
-
[ValidatorError](api/error-validation-js.html#error-validation-js) has `kind`, `path`,
99
+
[ValidatorError](api/error.html#error_Error-ValidatorError) has `kind`, `path`,
100
100
`value`, and `message` properties.
101
101
A ValidatorError also may have a `reason` property. If an error was
102
102
thrown in the validator, this property will contain the error that was
@@ -142,10 +142,10 @@ nested objects are not fully fledged paths.
142
142
### Update Validators
143
143
144
144
In the above examples, you learned about document validation. Mongoose also
145
-
supports validation for [`update()`](query.html#query_Query-update),
0 commit comments