switched everything over to Mongoose

This commit is contained in:
Luke Berndt
2023-04-10 22:51:57 -04:00
parent 0062c404bf
commit 6fbd97bbb6
9 changed files with 211 additions and 259 deletions

View File

@@ -0,0 +1,27 @@
var mongoose = require('mongoose');
let decodeErrorSchema = mongoose.Schema({
errorHistory: [Number],
spikeHistory: [Number],
})
let talkgroupStatsSchema = mongoose.Schema({
callCountHistory: [Number],
callAvgLenHistory: [Number]
})
var systemStatSchema = mongoose.Schema({
callTotals: [Number],
uploadErrors: [Number],
decodeErrorsFreq: {
type: Map,
of: decodeErrorSchema
},
talkgroupStats: {
type: Map,
of: talkgroupStatsSchema
},
shortName: String
}, { collection: 'system_stats' });
module.exports = mongoose.model('SystemStat', systemStatSchema);