mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 16:28:37 +01:00
new selfhosted version
This commit is contained in:
20
shared_global/schema/aggregation/AggSessionSchema.ts
Normal file
20
shared_global/schema/aggregation/AggSessionSchema.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { model, Schema } from 'mongoose';
|
||||
|
||||
export type TAggSession = {
|
||||
project_id: Schema.Types.ObjectId,
|
||||
domain: string,
|
||||
from: Date,
|
||||
to: Date,
|
||||
data: { _id: { date: Date }, count: number, timestamp: number }[]
|
||||
}
|
||||
|
||||
const AggSessionSchema = new Schema<TAggSession>({
|
||||
project_id: { type: Schema.Types.ObjectId, index: true },
|
||||
domain: { type: String, required: true },
|
||||
from: { type: Date, required: true },
|
||||
to: { type: Date, required: true },
|
||||
data: [{ type: Schema.Types.Mixed }]
|
||||
});
|
||||
|
||||
export const AggSessionModel = model<TAggSession>('agg_sessions', AggSessionSchema);
|
||||
|
||||
Reference in New Issue
Block a user