chat.js 440 Bytes
Newer Older
Soo Hyun Kim's avatar
Soo Hyun Kim committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import mongoose from 'mongoose'

const {String} = mongoose.Schema.Types

const ChatSchema = new mongoose.Schema({
    name: {
        type: String,
        required: true,
    },
    interest: {
        type: String,
        required: true,
        select: false
    },
    isOpen: {
Soo Hyun Kim's avatar
Soo Hyun Kim committed
16
        type: Boolean,
Soo Hyun Kim's avatar
Soo Hyun Kim committed
17
18
19
20
21
22
        required: true,
    }
}, {
    timestamps: true
})

Soo Hyun Kim's avatar
Soo Hyun Kim committed
23
export default mongoose.models.chat || mongoose.model('chat', ChatSchema)