-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathlabel.js
66 lines (59 loc) · 1.01 KB
/
label.js
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var winston = require('../config/winston');
var LabelEntrySchema = new Schema({
lang: {
type: String,
required: true,
index:true
},
data: {
type: Object,
required: true
},
category: {
type: String,
required: false,
index: true
},
default: {
type: Boolean,
// required: false,
// get: v => {
// console.log("v",v)
// if (v) {
// return v;
// } else {
// return false;
// }
// },
required: true,
default: false,
index: true
},
});
var LabelSchema = new Schema({
data: {
//type: Array,
type: [LabelEntrySchema],
required: true,
//index: true
},
attributes: {
type: Object,
},
id_project: {
type: String,
required: true,
index: true
},
createdBy: {
type: String,
required: true
}
},{
timestamps: true
}
);
var label = mongoose.model('label', LabelSchema);
module.exports = label;