-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.js
82 lines (74 loc) · 1.97 KB
/
schema.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const honeyJarPhotoSchema = new Schema({
_id: Schema.Types.ObjectId,
name: String,
photo: {
_meta: {
Location: String,
},
}
});
const locationDetailPhotoSchema = new Schema({
_id: Schema.Types.ObjectId,
name: String,
photo: {
_meta: {
Location: String,
},
}
});
const locationPhotoLinkSchema = new Schema({
BeekeeperLocation_left_id: Schema.Types.ObjectId,
locationDetailPhoto_right_id: Schema.Types.ObjectId,
})
const honeyInfoSchema = new Schema({
_id: Schema.Types.ObjectId,
batchId: String,
analyticaFile: {
_meta: {
Location: String,
},
},
mgo: Number,
rmpId: String,
mfgDate_utc: Date,
bbDate_utc: Date,
beekeeperLocation: Schema.Types.ObjectId,
JarImage: Schema.Types.ObjectId,
});
const beekeeperSchema = new Schema({
_id: Schema.Types.ObjectId,
name: String,
description: String,
isPublic: Boolean,
beekeeperProfileImage: {
_meta: {
Location: String,
},
},
});
const beekeeperLocationSchema = new Schema({
_id: Schema.Types.ObjectId,
name: String,
city: String,
postcode: String,
area: String,
latitude: Number,
longitude: Number,
shortDescription: String,
mapImage: {
_meta: {
Location: String,
},
},
beekeeper: Schema.Types.ObjectId,
});
module.exports = {
honeyInfo: mongoose.model('honeyinfos', honeyInfoSchema),
beekeeper: mongoose.model('beekeepers', beekeeperSchema),
beekeeperLocation: mongoose.model('beekeeperlocations', beekeeperLocationSchema),
honeyJarPhoto: mongoose.model('honeyjarphotos', honeyJarPhotoSchema),
locationDetailPhoto: mongoose.model('locationdetailphotos', locationDetailPhotoSchema),
locationPhotoLink: mongoose.model('beekeeperlocation_locationphotos_manies', locationPhotoLinkSchema),
};