import { MongoClient } from 'mongodb';
import { Storage } from './Storage';
-import type { Statistics } from '../../types/Statistics';
-import { StorageType } from '../../types/Storage';
-import Constants from '../../utils/Constants';
+import { type Statistics, StorageType } from '../../types';
+import { Constants } from '../../utils';
export class MongoDBStorage extends Storage {
private readonly client: MongoClient | null;
try {
this.checkDBConnection();
await this.client
- .db(this.dbName)
+ ?.db(this.dbName)
.collection<Statistics>(Constants.PERFORMANCE_RECORDS_TABLE)
.insertOne(performanceStatistics);
} catch (error) {