todoListModel created.

This commit is contained in:
joewaa 2017-06-10 23:28:43 +08:00 committed by GitHub
parent 613f92e5de
commit 9bdfd286fa

View file

@ -0,0 +1,25 @@
'use strict';
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var TaskSchema = new Schema({
name: {
type: String,
Required: 'Kindly enter the name of the task'
},
Created_date: {
type: Date,
default: Date.now
},
status: {
type: [{
type: String,
enum: ['pending', 'ongoing', 'completed']
}],
default: ['pending']
}
});
module.exports = mongoose.model('Tasks', TaskSchema);