Got rid of category objects and changed to just the number.

This commit is contained in:
M M committed 2024-07-15 14:42:15 -07:00
1 parent a36665396d
commit 3c2ea63fc7
1 file changed
+4 -19
+4 -19
View File
@@ -1,15 +1,5 @@
const mongoose = require("mongoose"); const mongoose = require("mongoose");
/**
* Mongoose schema for storing metrics from Google Lighthouse.
* @typedef {Object} MetricsSchema
* @property {mongoose.Schema.Types.ObjectId} monitorId - Reference to the Monitor model.
* @property {Object} accessibility - Metrics related to accessibility category.
* @property {Object} bestPractices - Metrics related to best practices category.
* @property {Object} seo - Metrics related to SEO category.
* @property {Object} performance - Metrics related to performance category.
*/
const MetricsSchema = mongoose.Schema( const MetricsSchema = mongoose.Schema(
{ {
monitorId: { monitorId: {
@@ -18,19 +8,19 @@ const MetricsSchema = mongoose.Schema(
immutable: true, immutable: true,
}, },
accessibility: { accessibility: {
type: Object, type: Number,
required: true, required: true,
}, },
bestPractices: { bestPractices: {
type: Object, type: Number,
required: true, required: true,
}, },
seo: { seo: {
type: Object, type: Number,
required: true, required: true,
}, },
performance: { performance: {
type: Object, type: Number,
required: true, required: true,
}, },
}, },
@@ -39,9 +29,4 @@ const MetricsSchema = mongoose.Schema(
} }
); );
/**
* Mongoose model for storing metrics from Google Lighthouse.
* @typedef {mongoose.Model<MetricsSchema>} LighthouseMetricsModel
*/
module.exports = mongoose.model("LighthouseMetrics", MetricsSchema); module.exports = mongoose.model("LighthouseMetrics", MetricsSchema);