@dnax/core 0.1.10 → 0.1.12
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 +21 -21
- package/package.json +1 -1
package/driver/mongo/rest.ts
CHANGED
|
@@ -171,7 +171,7 @@ class useRest {
|
|
|
171
171
|
|
|
172
172
|
result.docs = await this.#tenant.database.db
|
|
173
173
|
?.collection(collection)
|
|
174
|
-
.aggregate(pipeline, {
|
|
174
|
+
.aggregate(formatData(pipeline), {
|
|
175
175
|
allowDiskUse: true,
|
|
176
176
|
})
|
|
177
177
|
.toArray();
|
|
@@ -812,33 +812,32 @@ 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
|
+
|
|
831
|
+
session: this.#session ? this.#session : undefined,
|
|
832
|
+
}
|
|
833
|
+
);
|
|
835
834
|
|
|
836
835
|
if (col?.hooks?.afterUpdate && useHook) {
|
|
837
836
|
await col.hooks.afterUpdate({
|
|
838
837
|
sharedData: sharedData,
|
|
839
838
|
c: this.#c,
|
|
840
839
|
driver: "mongodb",
|
|
841
|
-
|
|
840
|
+
filter: filter,
|
|
842
841
|
action: "updateOne",
|
|
843
842
|
update: update,
|
|
844
843
|
session: sessionStorage(),
|
|
@@ -1037,6 +1036,7 @@ class useRest {
|
|
|
1037
1036
|
sharedData: sharedData,
|
|
1038
1037
|
id: id,
|
|
1039
1038
|
c: this.#c,
|
|
1039
|
+
io: Cfg.io,
|
|
1040
1040
|
driver: "mongodb",
|
|
1041
1041
|
action: "deleteOne",
|
|
1042
1042
|
session: sessionStorage(),
|