-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTasks.js
More file actions
43 lines (38 loc) · 841 Bytes
/
Tasks.js
File metadata and controls
43 lines (38 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
try {
mongoose.connect(String(process.env.DB), {useNewUrlParser: true, useUnifiedTopology: true}, () =>
console.log("connected"));
}catch (error) {
console.log(error)
console.log("could not connect");
}
// Task schema
var TaskSchema = new Schema({
"Title": {
type: String,
required: true
},
userID: {
type: String,
required: true
},
"Description": {
type: String,
required: false
},
"Duedate": {
type: Date, //Potentially change to string
},
"Duetime": {
type: String,
},
"TaskCompletion": {
},
"Status": {
type: Boolean,
default: 0
}
});
// return the model
module.exports = mongoose.model('tasks', TaskSchema);