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

40 lines
692 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',
});
// optional more indices
LogReviveSchema.index({war: 1, medic: 1});
module.exports = mongoose.model('LogRevive', LogReviveSchema);