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