aggregation optimization

This commit is contained in:
Emily
2024-09-02 18:36:52 +02:00
parent d499aa2f39
commit c003b655ec
6 changed files with 32 additions and 21 deletions

View File

@@ -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);