From 9bdfd286fa7bc40a2c820f444a80a7d09dd66cb9 Mon Sep 17 00:00:00 2001 From: joewaa Date: Sat, 10 Jun 2017 23:28:43 +0800 Subject: [PATCH] todoListModel created. --- api/models/todoListModel.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 api/models/todoListModel.js diff --git a/api/models/todoListModel.js b/api/models/todoListModel.js new file mode 100644 index 0000000..879a9d2 --- /dev/null +++ b/api/models/todoListModel.js @@ -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);