EntryLog.js 501 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import mongoose from 'mongoose'

const { String } = mongoose.Schema.Types

const EntryLogSchema = new mongoose.Schema({
    userId: {
        type: mongoose.ObjectId,
        required: true,
        ref: 'User',
    },
    room: {
        type: mongoose.ObjectId,
        required: true,
        ref: 'Room',
    },
    leaveTime: {
        type: String,
        required: true,
    }
}, {
    timestamps: true
})

export default mongoose.models.EntryLog || mongoose.model('EntryLog', EntryLogSchema)