fix(core): update
This commit is contained in:
@ -3,9 +3,12 @@ import { SmartdataCollection } from './smartdata.classes.collection';
|
||||
import { SmartdataDb } from './smartdata.classes.db';
|
||||
|
||||
export class CollectionFactory {
|
||||
public collections: {[key: string]: SmartdataCollection<any>} = {};
|
||||
public collections: { [key: string]: SmartdataCollection<any> } = {};
|
||||
|
||||
public getCollection = (nameArg: string, dbArg: SmartdataDb | (() => SmartdataDb)): SmartdataCollection<any> => {
|
||||
public getCollection = (
|
||||
nameArg: string,
|
||||
dbArg: SmartdataDb | (() => SmartdataDb)
|
||||
): SmartdataCollection<any> => {
|
||||
if (!this.collections[nameArg]) {
|
||||
this.collections[nameArg] = (() => {
|
||||
if (dbArg instanceof SmartdataDb) {
|
||||
@ -18,5 +21,5 @@ export class CollectionFactory {
|
||||
})();
|
||||
}
|
||||
return this.collections[nameArg];
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ export class SmartdataDb {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
maxPoolSize: 100,
|
||||
maxIdleTimeMS: 10
|
||||
maxIdleTimeMS: 10,
|
||||
});
|
||||
this.mongoDb = this.mongoDbClient.db(this.smartdataOptions.mongoDbName);
|
||||
this.status = 'connected';
|
||||
|
Reference in New Issue
Block a user