fix(core): update

This commit is contained in:
2021-11-12 17:22:31 +01:00
parent 8301eb79a2
commit 48cffb5ac2
8 changed files with 4985 additions and 3314 deletions

View File

@ -235,9 +235,7 @@ export class SmartdataCollection<T> {
await this.init();
await this.checkDoc(dbDocArg);
const identifiableObject = await dbDocArg.createIdentifiableObject();
await this.mongoDbCollection.deleteOne(identifiableObject, {
w: 1,
});
await this.mongoDbCollection.deleteOne(identifiableObject);
}
/**

View File

@ -7,8 +7,8 @@ export class SmartdataDbCursor<T = any> {
// STATIC
// INSTANCE
public mongodbCursor: plugins.mongodb.Cursor<T>;
constructor(cursorArg: plugins.mongodb.Cursor<T>) {
public mongodbCursor: plugins.mongodb.FindCursor<T>;
constructor(cursorArg: plugins.mongodb.FindCursor<T>) {
this.mongodbCursor = cursorArg
};

View File

@ -47,8 +47,6 @@ export class SmartdataDb {
.replace('<dbname>', this.smartdataOptions.mongoDbName);
this.mongoDbClient = await plugins.mongodb.MongoClient.connect(finalConnectionUrl, {
useNewUrlParser: true,
useUnifiedTopology: true,
maxPoolSize: 100,
maxIdleTimeMS: 10,
});
@ -78,7 +76,7 @@ export class SmartdataDb {
* @returns DbTable
*/
public async getSmartdataCollectionByName<T>(nameArg: string): Promise<SmartdataCollection<T>> {
const resultCollection = this.smartdataCollectionMap.find((dbTableArg) => {
const resultCollection = await this.smartdataCollectionMap.find(async (dbTableArg) => {
return dbTableArg.collectionName === nameArg;
});
return resultCollection;