mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
aggregation optimization
This commit is contained in:
@@ -15,7 +15,7 @@ const EventSchema = new Schema<TEvent>({
|
||||
metadata: Schema.Types.Mixed,
|
||||
session: { type: String },
|
||||
flowHash: { type: String },
|
||||
created_at: { type: Date, default: () => Date.now() },
|
||||
created_at: { type: Date, default: () => Date.now(), index: true },
|
||||
})
|
||||
|
||||
export const EventModel = model<TEvent>('events', EventSchema);
|
||||
|
||||
@@ -16,7 +16,7 @@ const SessionSchema = new Schema<TSession>({
|
||||
flowHash: { type: String },
|
||||
duration: { type: Number, required: true, default: 0 },
|
||||
updated_at: { type: Date, default: () => Date.now() },
|
||||
created_at: { type: Date, default: () => Date.now() },
|
||||
created_at: { type: Date, default: () => Date.now(), index: true },
|
||||
})
|
||||
|
||||
export const SessionModel = model<TSession>('sessions', SessionSchema);
|
||||
|
||||
Reference in New Issue
Block a user