You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
421 B
JavaScript
22 lines
421 B
JavaScript
3 years ago
|
const mongoose = require('mongoose');
|
||
|
|
||
|
const TaskSchema = new mongoose.Schema({
|
||
|
title: {
|
||
|
type: String,
|
||
|
required: true,
|
||
|
minLength: 1,
|
||
|
trim: true
|
||
|
},
|
||
|
_listId: {
|
||
|
type: mongoose.Types.ObjectId,
|
||
|
required: true
|
||
|
},
|
||
|
completed: {
|
||
|
type: Boolean,
|
||
|
default: false
|
||
|
}
|
||
|
});
|
||
|
|
||
|
const Task = mongoose.model('Task', TaskSchema);
|
||
|
|
||
|
module.exports = { Task };
|