Review.js 567 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
    link: {
        type: String,
Kim, Chaerin's avatar
Kim, Chaerin committed
11
        // 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
        type: String,
Kim, Chaerin's avatar
Kim, Chaerin committed
16
17
        // required: true,
    },
18
19
    keyword: {
        type: Array,
Kim, Chaerin's avatar
Kim, Chaerin committed
20
        // required: true,
Kim, Chaerin's avatar
Kim, Chaerin committed
21
22
23
    },
    time: {
        type: Array,
Kim, Chaerin's avatar
Kim, Chaerin committed
24
        // required: true,
Kim, Chaerin's avatar
Kim, Chaerin committed
25
26
27
28
29
30
    },
}, {
    timestamps: true
})

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