File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ SchemaString.prototype.trim = function(shouldTrim) {
381381 *
382382 * #### Example:
383383 *
384- * const schema = new Schema({ postalCode: { type: String, minlength : 5 })
384+ * const schema = new Schema({ postalCode: { type: String, minLength : 5 })
385385 * const Address = db.model('Address', schema)
386386 * const address = new Address({ postalCode: '9512' })
387387 * address.save(function (err) {
@@ -392,8 +392,8 @@ SchemaString.prototype.trim = function(shouldTrim) {
392392 *
393393 * // custom error messages
394394 * // We can also use the special {MINLENGTH} token which will be replaced with the minimum allowed length
395- * const minlength = [5, 'The value of path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).'];
396- * const schema = new Schema({ postalCode: { type: String, minlength: minlength })
395+ * const minLength = [5, 'The value of path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).'];
396+ * const schema = new Schema({ postalCode: { type: String, minLength: minLength })
397397 * const Address = mongoose.model('Address', schema);
398398 * const address = new Address({ postalCode: '9512' });
399399 * address.validate(function (err) {
Original file line number Diff line number Diff line change @@ -207,9 +207,11 @@ declare module 'mongoose' {
207207
208208 /** If set, Mongoose will add a custom validator that ensures the given string's `length` is at least the given number. */
209209 minlength ?: number | [ number , string ] | readonly [ number , string ] ;
210+ minLength ?: number | [ number , string ] | readonly [ number , string ] ;
210211
211212 /** If set, Mongoose will add a custom validator that ensures the given string's `length` is at most the given number. */
212213 maxlength ?: number | [ number , string ] | readonly [ number , string ] ;
214+ maxLength ?: number | [ number , string ] | readonly [ number , string ] ;
213215
214216 [ other : string ] : any ;
215217
You can’t perform that action at this time.
0 commit comments