fix(core): update
This commit is contained in:
parent
e6a36f22ac
commit
75b5f6af08
@ -120,8 +120,6 @@ export class SmartdataCollection<T> {
|
|||||||
await this.checkDoc(dbDocArg);
|
await this.checkDoc(dbDocArg);
|
||||||
const identifiableObject = await dbDocArg.createIdentifiableObject();
|
const identifiableObject = await dbDocArg.createIdentifiableObject();
|
||||||
const saveableObject = await dbDocArg.createSavableObject();
|
const saveableObject = await dbDocArg.createSavableObject();
|
||||||
console.log(identifiableObject);
|
|
||||||
console.log(saveableObject);
|
|
||||||
const updateableObject: any = {};
|
const updateableObject: any = {};
|
||||||
for (const key of Object.keys(saveableObject)) {
|
for (const key of Object.keys(saveableObject)) {
|
||||||
if (identifiableObject[key]) {
|
if (identifiableObject[key]) {
|
||||||
@ -129,7 +127,6 @@ export class SmartdataCollection<T> {
|
|||||||
}
|
}
|
||||||
updateableObject[key] = saveableObject[key];
|
updateableObject[key] = saveableObject[key];
|
||||||
}
|
}
|
||||||
console.log(updateableObject);
|
|
||||||
this.mongoDbCollection.updateOne(
|
this.mongoDbCollection.updateOne(
|
||||||
identifiableObject,
|
identifiableObject,
|
||||||
{ $set: updateableObject },
|
{ $set: updateableObject },
|
||||||
@ -141,7 +138,9 @@ export class SmartdataCollection<T> {
|
|||||||
await this.init();
|
await this.init();
|
||||||
await this.checkDoc(dbDocArg);
|
await this.checkDoc(dbDocArg);
|
||||||
const identifiableObject = await dbDocArg.createIdentifiableObject();
|
const identifiableObject = await dbDocArg.createIdentifiableObject();
|
||||||
await this.mongoDbCollection.deleteOne(identifiableObject);
|
await this.mongoDbCollection.deleteOne(identifiableObject, {
|
||||||
|
w: 1
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user