@dnax/core 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/mongo/rest.ts +19 -20
- package/package.json +1 -1
package/driver/mongo/rest.ts
CHANGED
|
@@ -812,33 +812,31 @@ class useRest {
|
|
|
812
812
|
});
|
|
813
813
|
}
|
|
814
814
|
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
{
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
updatedAt: true,
|
|
826
|
-
},
|
|
815
|
+
result.doc = await this.#tenant.database.db
|
|
816
|
+
?.collection(collection)
|
|
817
|
+
.findOneAndUpdate(
|
|
818
|
+
{
|
|
819
|
+
...(formatData(filter) || {}),
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
...formatData(omit(update, omitUpdate)),
|
|
823
|
+
$currentDate: {
|
|
824
|
+
updatedAt: true,
|
|
827
825
|
},
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
upsert: true,
|
|
829
|
+
returnDocument: "after",
|
|
830
|
+
session: this.#session ? this.#session : undefined,
|
|
831
|
+
}
|
|
832
|
+
);
|
|
835
833
|
|
|
836
834
|
if (col?.hooks?.afterUpdate && useHook) {
|
|
837
835
|
await col.hooks.afterUpdate({
|
|
838
836
|
sharedData: sharedData,
|
|
839
837
|
c: this.#c,
|
|
840
838
|
driver: "mongodb",
|
|
841
|
-
|
|
839
|
+
filter: filter,
|
|
842
840
|
action: "updateOne",
|
|
843
841
|
update: update,
|
|
844
842
|
session: sessionStorage(),
|
|
@@ -1037,6 +1035,7 @@ class useRest {
|
|
|
1037
1035
|
sharedData: sharedData,
|
|
1038
1036
|
id: id,
|
|
1039
1037
|
c: this.#c,
|
|
1038
|
+
io: Cfg.io,
|
|
1040
1039
|
driver: "mongodb",
|
|
1041
1040
|
action: "deleteOne",
|
|
1042
1041
|
session: sessionStorage(),
|