todoListModel created.
This commit is contained in:
parent
613f92e5de
commit
9bdfd286fa
1 changed files with 25 additions and 0 deletions
25
api/models/todoListModel.js
Normal file
25
api/models/todoListModel.js
Normal 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);
|
Loading…
Add table
Add a link
Reference in a new issue