mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 15:47:48 +01:00
15 lines
313 B
JavaScript
15 lines
313 B
JavaScript
const mongoose = require('mongoose');
|
|
|
|
const { Schema } = mongoose;
|
|
|
|
const todoSchema = Schema({
|
|
text: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
list: { type: Schema.Types.ObjectId, ref: 'TodoList', required: true },
|
|
completed: { type: Boolean, default: false },
|
|
});
|
|
|
|
mongoose.model('Todo', todoSchema);
|