-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel.js
More file actions
88 lines (74 loc) · 1.72 KB
/
model.js
File metadata and controls
88 lines (74 loc) · 1.72 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
var mongoose = require('mongoose');
var conf = require('./conf');
var Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
mongoose.connect(conf.mongo_url);
var School = new Schema({
name: { type: String, unique: true },
md5: String
});
var Company = new Schema({
name: { type: String, unique: true },
md5: String
});
var Education = new Schema({
title: String,
summary: String,
start: Date,
end: Date,
school: String
});
var Job = new Schema({
title: String,
summary: String,
start: Date,
end: Date,
company: String
});
var Skill = new Schema({
name: String,
auto: { type: Boolean, default: false },
level: Number
});
var DominantSkill = new Schema({
name: String,
level: Number
});
var ServiceLink = new Schema({
type : String,
id : String,
data : {}
});
var Publication = new Schema({
title: String,
url: String
});
var User = new Schema({
slug : { type: String, unique: true },
email : { type: String, unique: true },
registered : Boolean,
title: String,
name: String,
lastNames: String,
place: String,
url: [String],
phone: [String],
summary: String,
filled: Boolean,
services : [ServiceLink],
skills: [Skill],
jobs: [Job],
educations: [Education],
affiliations: [String],
publications: [Publication],
created : Date
});
mongoose.model('User', User);
mongoose.model('DominantSkill', DominantSkill);
mongoose.model('Company', Company);
mongoose.model('School', School);
//Add exports
exports.User = mongoose.model('User');
exports.DominantSkill = mongoose.model('DominantSkill');
exports.Company = mongoose.model('Company');
exports.School = mongoose.model('School');