fix(analytics): remove duplicate sessionId index in PageViewSchema

- PageViewSchema had 'index: true' on sessionId field (line 16)
- AND compound index PageViewSchema.index({ sessionId: 1, timestamp: -1 })
- Compound index already covers sessionId queries (leftmost prefix)
- Removed redundant single-field index to eliminate Mongoose warning
This commit is contained in:
TheFlow 2025-10-24 10:22:41 +13:00
parent d8fdeddb8d
commit d108da8ef8

View file

@ -13,7 +13,7 @@ const PageViewSchema = new mongoose.Schema({
// Visitor Information (privacy-respecting)
visitorId: { type: String, required: true, index: true }, // Hashed IP + User Agent
sessionId: { type: String, required: true, index: true }, // Session identifier
sessionId: { type: String, required: true }, // Session identifier (indexed via compound index below)
// Request Details
userAgent: { type: String },