udemy-node-todo-app/server/models/todo.js

19 lines
300 B
JavaScript
Raw Permalink Normal View History

2017-11-30 03:52:44 +00:00
var mongoose = require('mongoose')
var Todo = mongoose.model('Todo', {
text: {
type: String,
required: true,
minlength: 1,
trim: true,
},
completed: {
type: Boolean,
default: false
},
completedAt:{
type: Number,
default: null
}
});
module.exports = {Todo}