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:
parent
d8fdeddb8d
commit
d108da8ef8
1 changed files with 1 additions and 1 deletions
|
|
@ -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 },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue