-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserModel.js
50 lines (48 loc) · 988 Bytes
/
UserModel.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
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
// schema for the users
let userSchema = Schema({
username: {
type: String,
required: true,
},
password: {
type: String,
required: true,
},
isArtist: {
type: Boolean,
required: true,
},
following: {
type: [String],
required: true,
},
liked: {
type: [String],
required: true,
},
reviewed: [{
artworkId: {
type: String,
required: true
},
reviewText: {
type: String,
required: true
}
}],
numArtwork: {
type: Number,
required: true
},
workshops: {
type: [String],
required: true
},
notifications: {
type: [String],
required: true,
}
});
module.exports = mongoose.model("User", userSchema);