X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fperformance%2Fstorage%2FMongoDBStorage.ts;h=aff757b5c343c58850bc36a9ac990ca37491f683;hb=c3da35d496cbb2c78e85fb3d2e125ffd6fd297f4;hp=54fc43349b2f3cbe8dbabc36ec3cd53dbc692936;hpb=78202038ffd2aca15aa97f45bc66ba42f40f2ec4;p=e-mobility-charging-stations-simulator.git diff --git a/src/performance/storage/MongoDBStorage.ts b/src/performance/storage/MongoDBStorage.ts index 54fc4334..aff757b5 100644 --- a/src/performance/storage/MongoDBStorage.ts +++ b/src/performance/storage/MongoDBStorage.ts @@ -3,9 +3,8 @@ 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; @@ -24,7 +23,7 @@ export class MongoDBStorage extends Storage { try { this.checkDBConnection(); await this.client - .db(this.dbName) + ?.db(this.dbName) .collection(Constants.PERFORMANCE_RECORDS_TABLE) .insertOne(performanceStatistics); } catch (error) {