add session to visits and events

This commit is contained in:
Emily
2024-06-10 04:15:31 +02:00
parent 5a48ef53b4
commit f35e24efa8
3 changed files with 9 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ export type TEvent = {
project_id: Schema.Types.ObjectId,
name: string,
metadata: Record<string, string>,
session: string,
created_at: Date
}
@@ -11,6 +12,7 @@ const EventSchema = new Schema<TEvent>({
project_id: { type: Types.ObjectId, index: 1 },
name: { type: String, required: true },
metadata: Schema.Types.Mixed,
session: { type: String },
created_at: { type: Date, default: () => Date.now() },
})