Place.js 808 Bytes
Newer Older
Kim, Chaerin's avatar
Kim, Chaerin committed
1
2
import mongoose from 'mongoose'

3
const { String } = mongoose.Schema.Types
Kim, Chaerin's avatar
Kim, Chaerin committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

const PlaceSchema = new mongoose.Schema({
    name: {
        type: String,
        required: true,
    },
    address: {
        type: String,
        required: true,
        unique: true,
    },
    img: {
        type: String,
        required: true,
        default: "https://t1.daumcdn.net/thumb/R600x0/?fname=http%3A%2F%2Ft1.daumcdn.net%2Fqna%2Fimage%2F4b035cdf8372d67108f7e8d339660479dfb41bbd",
    },
20
21
22
23
    search: {
        type: Array,
        required: true,
    },
Kim, Chaerin's avatar
Kim, Chaerin committed
24
25
26
27
    time: {
        type: Array,
        required: true,
    },
baesangjune's avatar
.    
baesangjune committed
28
29
30
31
32
33
34
    category: {
        type: String,
    },
    times: {
        type: Array
    },

Kim, Chaerin's avatar
Kim, Chaerin committed
35
36
37
38
}, {
    timestamps: true
})

baesangjune's avatar
.    
baesangjune committed
39
export default mongoose.models.Places || mongoose.model('Place', PlaceSchema)