length validations

This commit is contained in:
2018-06-01 19:39:43 +03:00
parent 9c354f5445
commit ca6281e2a6
3 changed files with 6 additions and 0 deletions

View File

@@ -13,6 +13,8 @@ const UserSchema = Schema({
required: true,
unique: true,
validate: /^\S*$/,
minLength: 3,
maxLength: 50,
},
lists: [{ type: Schema.Types.ObjectId, ref: 'TodoList' }],
todos: [{ type: Schema.Types.ObjectId, ref: 'Todo' }],