-
Notifications
You must be signed in to change notification settings - Fork 2
/
user.js
59 lines (56 loc) · 1.97 KB
/
user.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
const mongoose = require('mongoose');
const userSchema = new mongoose.Schema({
firstName: { type : String, required: true },
lastName: { type : String, required: true },
userName: { type : String },
city: { type : String },
state: { type : String },
country: { type : String },
email: { type : String, required: true, unique: true },
password: { type : String, required: true },
bio: { type : String },
profilePicture: { type : String },
ratings : [{
id: { type : String },
original_title: { type : String },
poster_path: { type : String },
overview: { type : String },
rating: { type : Number },
}],
watched : [{
id : { type : String },
original_title : { type : String },
poster_path : { type : String },
overview: { type : String },
}],
watchList : [{
id : { type : String },
original_title : { type : String },
poster_path : { type : String },
overview: { type : String },
}],
liked : [{
id : { type : String },
original_title : { type : String },
poster_path : { type : String },
overview: { type : String },
}],
disliked : [{
id : { type : String },
original_title : { type : String },
poster_path : { type : String },
overview: { type : String }
}],
playlists : [{
name : { type : String },
videos : [{
id : { type : String },
original_title : { type : String },
poster_path : { type : String },
overview: { type : String }
}],
}],
recentSearches : [String],
}, { timestamps: { type : true }});
const User = mongoose.model('User', userSchema);
module.exports = User;