@dnax/core 0.54.4 → 0.57.0
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 +18 -31
- package/package.json +1 -1
package/driver/mongo/rest.ts
CHANGED
|
@@ -160,17 +160,14 @@ class useRest {
|
|
|
160
160
|
};
|
|
161
161
|
}[]
|
|
162
162
|
> => {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
.list(this.#tenant, params || {})
|
|
172
|
-
.then((e) => e)
|
|
173
|
-
.catch((err) => []);
|
|
163
|
+
return new Promise(async (resolve, reject) => {
|
|
164
|
+
try {
|
|
165
|
+
let response = await this.find(collection, params);
|
|
166
|
+
resolve(response);
|
|
167
|
+
} catch (err) {
|
|
168
|
+
return reject(err);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
174
171
|
},
|
|
175
172
|
};
|
|
176
173
|
|
|
@@ -458,7 +455,7 @@ class useRest {
|
|
|
458
455
|
collection: collection,
|
|
459
456
|
data: {
|
|
460
457
|
data: data,
|
|
461
|
-
|
|
458
|
+
_id: data?._id,
|
|
462
459
|
},
|
|
463
460
|
transaction: this.#session ? true : false,
|
|
464
461
|
action: "insertOne",
|
|
@@ -602,7 +599,7 @@ class useRest {
|
|
|
602
599
|
collection: collection,
|
|
603
600
|
data: {
|
|
604
601
|
data: toJson(data),
|
|
605
|
-
|
|
602
|
+
_ids: data?.map((e) => e?._id),
|
|
606
603
|
},
|
|
607
604
|
action: "insertMany",
|
|
608
605
|
transaction: this.#session ? true : false,
|
|
@@ -1223,8 +1220,8 @@ class useRest {
|
|
|
1223
1220
|
collection: collection,
|
|
1224
1221
|
data: {
|
|
1225
1222
|
update: update,
|
|
1226
|
-
|
|
1227
|
-
|
|
1223
|
+
_id: id,
|
|
1224
|
+
_ids: [id],
|
|
1228
1225
|
},
|
|
1229
1226
|
transaction: this.#session ? true : false,
|
|
1230
1227
|
action: "updateOne",
|
|
@@ -1654,7 +1651,7 @@ class useRest {
|
|
|
1654
1651
|
collection: collection,
|
|
1655
1652
|
data: {
|
|
1656
1653
|
update: update,
|
|
1657
|
-
|
|
1654
|
+
_ids: ids,
|
|
1658
1655
|
},
|
|
1659
1656
|
action: "updateMany",
|
|
1660
1657
|
transaction: this.#session ? true : false,
|
|
@@ -1792,7 +1789,8 @@ class useRest {
|
|
|
1792
1789
|
collection: collection,
|
|
1793
1790
|
data: {
|
|
1794
1791
|
data: doc,
|
|
1795
|
-
|
|
1792
|
+
_id: id,
|
|
1793
|
+
_ids: [id],
|
|
1796
1794
|
},
|
|
1797
1795
|
transaction: this.#session ? true : false,
|
|
1798
1796
|
action: "deleteOne",
|
|
@@ -1929,8 +1927,8 @@ class useRest {
|
|
|
1929
1927
|
restActivity.save(this.#tenant, {
|
|
1930
1928
|
collection: collection,
|
|
1931
1929
|
data: {
|
|
1932
|
-
|
|
1933
|
-
|
|
1930
|
+
data: null,
|
|
1931
|
+
_ids: ids,
|
|
1934
1932
|
},
|
|
1935
1933
|
transaction: this.#session ? true : false,
|
|
1936
1934
|
action: "deleteMany",
|
|
@@ -2034,18 +2032,7 @@ const restActivity = {
|
|
|
2034
2032
|
$sort?: {};
|
|
2035
2033
|
$skip?: number;
|
|
2036
2034
|
}
|
|
2037
|
-
) => {
|
|
2038
|
-
return await tenant.database.db
|
|
2039
|
-
?.collection("___activity__")
|
|
2040
|
-
.find({
|
|
2041
|
-
...filter?.$match,
|
|
2042
|
-
})
|
|
2043
|
-
.limit(filter?.$limit || 100)
|
|
2044
|
-
.sort({ createdAt: -1, ...filter?.$sort })
|
|
2045
|
-
.skip(filter?.$skip || 0)
|
|
2046
|
-
.toArray()
|
|
2047
|
-
.catch((err) => []);
|
|
2048
|
-
},
|
|
2035
|
+
) => {},
|
|
2049
2036
|
save: async (
|
|
2050
2037
|
tenant: Tenant,
|
|
2051
2038
|
activity: {
|