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

@@ -6,6 +6,8 @@ const TodoSchema = Schema({
text: {
type: String,
required: true,
minLength: 1,
maxLength: 300,
},
list: { type: Schema.Types.ObjectId, ref: 'TodoList', required: true },
user: { type: Schema.Types.ObjectId, ref: 'User', required: true },