opt-cc/server/models/logs/revive.js

41 lines
713 B
JavaScript

'use strict';
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const LogReviveSchema = new Schema({
war: {
type: mongoose.Schema.Types.ObjectId,
ref: 'War',
required: true,
},
time: {
type: Date,
required: true,
},
medic: {
type: String,
required: true,
},
patient: {
type: String,
required: true,
},
stabilized: {
type: Boolean,
required: true,
},
fraction: {
type: String,
enum: ['BLUFOR', 'OPFOR'],
required: true,
},
}, {
collection: 'logRevive',
versionKey: false,
});
// optional more indices
LogReviveSchema.index({war: 1, medic: 1});
module.exports = mongoose.model('LogRevive', LogReviveSchema);