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

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