'use strict'; const mongoose = require('mongoose'); const Schema = mongoose.Schema; const CampaignSchema = new Schema({ title: { type: String, required: true, }, fractionMappingBlufor: { type: String, enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'], default: 'BLUFOR', }, fractionMappingOpfor: { type: String, enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'], default: 'OPFOR', }, }, { collection: 'campaign', timestamps: {createdAt: 'timestamp'}, }); // optional more indices CampaignSchema.index({timestamp: 1}); module.exports = mongoose.model('Campaign', CampaignSchema);