From d8fdeddb8d936852681d108738dff050d0823ca1 Mon Sep 17 00:00:00 2001 From: TheFlow Date: Fri, 24 Oct 2025 10:21:31 +1300 Subject: [PATCH] fix(analytics): remove duplicate sessionId index definition - SessionSchema had both 'unique: true' and 'index: true' - unique already creates an index, making index redundant - Resolves Mongoose warning about duplicate schema index --- src/models/Analytics.model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/Analytics.model.js b/src/models/Analytics.model.js index abe04515..51c8519c 100644 --- a/src/models/Analytics.model.js +++ b/src/models/Analytics.model.js @@ -46,7 +46,7 @@ PageViewSchema.index({ sessionId: 1, timestamp: -1 }); // Session Schema const SessionSchema = new mongoose.Schema({ - sessionId: { type: String, required: true, unique: true, index: true }, + sessionId: { type: String, required: true, unique: true }, // unique already creates index visitorId: { type: String, required: true, index: true }, startTime: { type: Date, default: Date.now },