initial commit
This commit is contained in:
15
app/models/Todo.js
Normal file
15
app/models/Todo.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const TodoSchema = new Schema({
|
||||
task: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
created_at: {
|
||||
type: Date,
|
||||
default: Date.now()
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = Todo = mongoose.model('todos', TodoSchema);
|
||||
Reference in New Issue
Block a user