mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 23:57:49 +01:00
init
This commit is contained in:
14
models/TodoList.js
Normal file
14
models/TodoList.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
const { Schema } = mongoose;
|
||||
|
||||
const todoListSchema = Schema({
|
||||
_id: Schema.Types.ObjectId,
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
todos: [{ type: Schema.Types.ObjectId, ref: 'Todo' }],
|
||||
});
|
||||
|
||||
mongoose.model('TodoList', todoListSchema);
|
||||
Reference in New Issue
Block a user