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

40 lines
760 B
JavaScript
Raw Normal View History

2018-03-12 09:26:44 +01:00
'use strict';
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const LogVehicleKillSchema = new Schema({
war: {
type: mongoose.Schema.Types.ObjectId,
ref: 'War',
2018-03-12 09:26:44 +01:00
required: true,
},
time: {
type: Date,
2018-03-12 09:26:44 +01:00
required: true,
},
shooter: {
2018-03-12 09:26:44 +01:00
type: String,
},
target: {
type: String,
2018-03-12 09:26:44 +01:00
required: true,
},
fraction: {
type: String,
enum: ['BLUFOR', 'OPFOR', 'NONE'],
2018-03-12 09:26:44 +01:00
required: true,
},
vehicleClass: {
type: String,
enum: ['LIGHT', 'HEAVY', 'AIR', "UNKNOWN"],
required: true,
},
}, {
2018-03-12 09:26:44 +01:00
collection: 'logVehicle',
});
// optional more indices
LogVehicleKillSchema.index({war: 1, shooter: 1, target: 1});
module.exports = mongoose.model('LogVehicle', LogVehicleKillSchema);