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

39 lines
678 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 LogKillSchema = new Schema({
war: {
type: mongoose.Schema.Types.ObjectId,
ref: 'War',
required: true
},
time: {
2017-10-29 17:36:55 +01:00
type: Date,
2017-10-21 18:23:04 +02:00
required: true
},
shooter: {
type: String
2017-10-21 18:23:04 +02:00
},
target: {
type: String,
required: true
},
friendlyFire: {
type: Boolean,
required: true
},
fraction: {
type: String,
enum: ['BLUFOR', 'OPFOR', 'NONE'],
required: true
2017-10-21 18:23:04 +02:00
}
}, {
collection: 'logKill'
});
// optional more indices
LogKillSchema.index({war: 1, shooter: 1, target: 1});
module.exports = mongoose.model('LogKill', LogKillSchema);