Files
trunk-server/backend/models/event.js
Luke Berndt b23734c4a3 Events is functional!!!
Just need to clean some things up and test
2023-01-22 21:56:53 -05:00

24 lines
491 B
JavaScript

var mongoose = require('mongoose');
var {callSchema} = require('./call');
console.log(callSchema)
var eventSchema = mongoose.Schema({
title: String,
description: String,
expireTime: Date,
startTime: Date,
endTime: Date,
shortNames: [String],
calls: [callSchema],
numCalls: Number
},
{
timestamps: true
});
// add virtual if You want
eventSchema.virtual('callCount').get(function () {
return this.calls.length;
});
module.exports = mongoose.model('Event', eventSchema);