35 lines
644 B
JavaScript
35 lines
644 B
JavaScript
|
"use strict";
|
||
|
|
||
|
const mongoose = require('mongoose');
|
||
|
const Schema = mongoose.Schema;
|
||
|
|
||
|
const LogVehicleKillSchema = new Schema({
|
||
|
war: {
|
||
|
type: mongoose.Schema.Types.ObjectId,
|
||
|
ref: 'War',
|
||
|
required: true
|
||
|
},
|
||
|
time: {
|
||
|
type: Date,
|
||
|
required: true
|
||
|
},
|
||
|
shooter: {
|
||
|
type: String
|
||
|
},
|
||
|
target: {
|
||
|
type: String,
|
||
|
required: true
|
||
|
},
|
||
|
fraction: {
|
||
|
type: String,
|
||
|
enum: ['BLUFOR', 'OPFOR', 'NONE'],
|
||
|
required: true
|
||
|
}
|
||
|
}, {
|
||
|
collection: 'logVehicle'
|
||
|
});
|
||
|
// optional more indices
|
||
|
LogVehicleKillSchema.index({war: 1, shooter: 1, target: 1});
|
||
|
|
||
|
module.exports = mongoose.model('LogVehicle', LogVehicleKillSchema);
|