mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-09 23:37:31 -05:00
26 lines
537 B
JavaScript
26 lines
537 B
JavaScript
var mongoose = require('mongoose');
|
|
const frozenCallSchema = require('./frozenCallSchema');
|
|
|
|
|
|
var eventSchema = mongoose.Schema({
|
|
title: String,
|
|
description: String,
|
|
expireTime: Date,
|
|
startTime: Date,
|
|
endTime: Date,
|
|
downloadUrl: String,
|
|
podcastUrl: String,
|
|
shortNames: [String],
|
|
calls: [frozenCallSchema],
|
|
numCalls: Number
|
|
},
|
|
{
|
|
timestamps: true
|
|
});
|
|
|
|
// add virtual if You want
|
|
eventSchema.virtual('callCount').get(function () {
|
|
return this.calls.length;
|
|
});
|
|
module.exports = mongoose.model('Event', eventSchema);
|