Review.js 555 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({
Kim, Chaerin's avatar
?    
Kim, Chaerin committed
6
7
8
    title: {
        type: String,
    },
Kim, Chaerin's avatar
Kim, Chaerin committed
9
10
11
    link: {
        type: String,
        required: true,
Kim, Chaerin's avatar
?    
Kim, Chaerin committed
12
        unique: true,
Kim, Chaerin's avatar
Kim, Chaerin committed
13
    },
Kim, Chaerin's avatar
?    
Kim, Chaerin 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
30
        required: true,
    },
    time: {
        type: Array,
        required: true,
    },
}, {
    timestamps: true
})

export default mongoose.models.Review || mongoose.model('Review', ReviewSchema)