-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmongoose.js
117 lines (89 loc) · 2.17 KB
/
mongoose.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//Database
const { MongooseDocument } = require('mongoose');
const mongoose = require('mongoose');
mongoose.connect("mongodb+srv://@cluster0.n1jec.mongodb.net/arkaDB" , {useNewUrlParser: true, useUnifiedTopology: true});
//Database
mongoose.set('useFindAndModify', false);
mongoose.set('useCreateIndex', true);
const articleSchema = new mongoose.Schema({
type: String,
title: String,
descrition: String,
credits:{
forcaption: String,
forposter: String
},
hashtags: String,
date: String
});
// artilce = arkafacts
const arkaEventSchema = new mongoose.Schema({
type: String,
title: String,
descrition: String,
hashtags: String,
date: String
});
const arkaActivitySchema = new mongoose.Schema({
type: String,
title: String,
descrition: String,
hashtags: String,
date: String
});
const arkaNewsSchema = new mongoose.Schema({
type: String,
title: String,
descrition: String,
hashtags: String,
date: String
});
const imageSchema = new mongoose.Schema({
title: String, // Name
type: String,
filename:{
type:String,
unique:true,
required: true
},
contentType:{
type:String,
required: true
},
imageBase64:{
type:String,
required: true
}
});
const memberSchema = new mongoose.Schema({
name:String,
year: String,
branch: String,
links:{
phone: String,
github: String,
linkedln: String,
email: String
}
});
const userSchema = new mongoose.Schema({
email: String,
password: String,
googleId: String
});
const Article = mongoose.model("Article",articleSchema);
const Image = mongoose.model("Image",imageSchema);
const Member = mongoose.model("Member",memberSchema);
const User = mongoose.model("User",userSchema);
const ArkaEvent = mongoose.model("ArkaEvent",arkaEventSchema);
const ArkaActivity = mongoose.model("ArkaActivity",arkaActivitySchema);
const ArkaNews = mongoose.model("ArkaNews",arkaNewsSchema);
module.exports = {
Article: Article,
Image: Image,
Member: Member,
User: User,
ArkaEvent: ArkaEvent,
ArkaActivity: ArkaActivity,
ArkaNews: ArkaNews,
}