Skip to content

Commit ec9ce6f

Browse files
ffs
1 parent 119f5c4 commit ec9ce6f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

modules/module-mongodb-storage/src/storage/MongoReportStorage.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ export class MongoReportStorage implements storage.ReportStorageFactory {
1818
}
1919

2020
async reportSdkConnect(data: SdkConnectDocument): Promise<void> {
21-
await this.db.sdk_report_events.insertOne(data);
21+
const res = await this.db.sdk_report_events.insertOne(data);
22+
console.log(res);
2223
}
2324
async reportSdkDisconnect(data: SdkConnectDocument): Promise<void> {
2425
const { _id, ...rest } = data;
25-
await this.db.sdk_report_events.findOneAndUpdate({ _id }, rest, { upsert: true });
26+
const res = await this.db.sdk_report_events.findOneAndUpdate({ _id }, rest, { upsert: true });
27+
console.log(res);
2628
}
2729
async listCurrentConnections(data: event_types.PaginatedInstanceRequest): Promise<void> {
2830
console.log('MongoReportStorage.listCurrentConnections', data);

packages/types/src/events.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export type SdkDisconnectEventData = {
2626
disconnect_at: Date;
2727
} & SdkUserData;
2828

29+
// Mongodb document type for SDK connect and disconnect events
2930
export type SdkConnectDocument = {
3031
_id: bson.ObjectId;
3132
sdk: string;

0 commit comments

Comments
 (0)