mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
aggregation optimization
This commit is contained in:
@@ -36,8 +36,10 @@ const VisitSchema = new Schema<TVisit>({
|
||||
website: { type: String, required: true },
|
||||
page: { type: String, required: true },
|
||||
referrer: { type: String, required: true },
|
||||
created_at: { type: Date, default: () => Date.now(), index: true },
|
||||
created_at: { type: Date, default: () => Date.now() },
|
||||
})
|
||||
|
||||
VisitSchema.index({ project_id: 1, created_at: -1 });
|
||||
|
||||
export const VisitModel = model<TVisit>('visits', VisitSchema);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user