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

40 lines
686 B
JavaScript
Raw Normal View History

2017-10-21 18:23:04 +02:00
"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: {
2017-10-24 20:21:06 +02:00
type: Number,
2017-10-21 18:23:04 +02:00
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
2017-10-21 18:23:04 +02:00
}
}, {
collection: 'logRevive'
});
// optional more indices
LogReviveSchema.index({war: 1, medic: 1});
module.exports = mongoose.model('LogRevive', LogReviveSchema);