Review.js 500 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
24
25
26
    },
}, {
    timestamps: true
})

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