Review.js 556 Bytes
Newer Older
Kim, Chaerin's avatar
Kim, Chaerin committed
1
2
3
4
5
import mongoose from 'mongoose'

const { String } = mongoose.Schema.Types

const ReviewSchema = new mongoose.Schema({
baesangjune's avatar
.    
baesangjune committed
6
7
8
    title: {
        type: String,
    },
Kim, Chaerin's avatar
Kim, Chaerin committed
9
10
11
    link: {
        type: String,
        required: true,
baesangjune's avatar
.    
baesangjune committed
12
        unique: true,
Kim, Chaerin's avatar
Kim, Chaerin committed
13
    },
baesangjune's avatar
.    
baesangjune committed
14
    summary: {
Kim, Chaerin's avatar
Kim, Chaerin committed
15
16
17
        type: String,
        required: true,
    },
18
19
    keyword: {
        type: Array,
Kim, Chaerin's avatar
Kim, Chaerin committed
20
21
22
23
24
25
26
27
28
29
        required: true,
    },
    time: {
        type: Array,
        required: true,
    },
}, {
    timestamps: true
})

baesangjune's avatar
.    
baesangjune committed
30
export default mongoose.models.Review || mongoose.model('Review', ReviewSchema)