fix(core): update
This commit is contained in:
@ -56,7 +56,7 @@ export class SmartdataCollection<T> {
|
||||
await this.smartdataDb.mongoDb.createCollection(this.collectionName);
|
||||
}
|
||||
this.mongoDbCollection = await this.smartdataDb.mongoDb.collection(this.collectionName);
|
||||
console.log(`Successfully initiated Collection ${this.collectionName}`)
|
||||
console.log(`Successfully initiated Collection ${this.collectionName}`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,8 +64,8 @@ export class SmartdataCollection<T> {
|
||||
* mark unique index
|
||||
*/
|
||||
markUniqueIndexes(keyArrayArg: string[] = []) {
|
||||
for(let key of keyArrayArg) {
|
||||
if(!this.uniqueIndexes.includes(key)) {
|
||||
for (let key of keyArrayArg) {
|
||||
if (!this.uniqueIndexes.includes(key)) {
|
||||
this.mongoDbCollection.createIndex(key, {
|
||||
unique: true
|
||||
});
|
||||
|
@ -70,9 +70,10 @@ export class SmartdataDb {
|
||||
async close(): Promise<any> {
|
||||
await this.mongoDbClient.close();
|
||||
this.status = 'disconnected';
|
||||
plugins.smartlog
|
||||
.defaultLogger
|
||||
.log('info', `disconnected from database ${this.smartdataOptions.mongoDbName}`);
|
||||
plugins.smartlog.defaultLogger.log(
|
||||
'info',
|
||||
`disconnected from database ${this.smartdataOptions.mongoDbName}`
|
||||
);
|
||||
}
|
||||
|
||||
// handle table to class distribution
|
||||
|
@ -39,7 +39,7 @@ export function unI() {
|
||||
}
|
||||
target.saveableProperties.push(key);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export class SmartDataDbDoc<T> {
|
||||
/**
|
||||
|
Reference in New Issue
Block a user