@dnax/core 0.71.1 → 0.73.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 +25 -8
- package/package.json +1 -1
package/driver/mongo/rest.ts
CHANGED
|
@@ -156,7 +156,12 @@ class useRest {
|
|
|
156
156
|
client: this.#tenant.searchEngine?.meilisearch?.client!,
|
|
157
157
|
};
|
|
158
158
|
this.activity = {
|
|
159
|
-
aggregate: async (
|
|
159
|
+
aggregate: async (
|
|
160
|
+
pipeline: Array<object>,
|
|
161
|
+
options?: {
|
|
162
|
+
cleanDeep?: boolean;
|
|
163
|
+
}
|
|
164
|
+
) => {
|
|
160
165
|
return await restActivity.aggregate(this.#tenant, pipeline);
|
|
161
166
|
},
|
|
162
167
|
save: async (activityInput: activityInput) => {
|
|
@@ -2613,13 +2618,25 @@ const restActivity = {
|
|
|
2613
2618
|
$skip?: number;
|
|
2614
2619
|
}
|
|
2615
2620
|
) => {},
|
|
2616
|
-
aggregate: async (
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2621
|
+
aggregate: async (
|
|
2622
|
+
tenant: Tenant,
|
|
2623
|
+
pipeline: Array<object>,
|
|
2624
|
+
options?: { cleanDeep?: boolean }
|
|
2625
|
+
): Promise<any> => {
|
|
2626
|
+
return new Promise(async (resolve, reject) => {
|
|
2627
|
+
try {
|
|
2628
|
+
pipeline = options?.cleanDeep ? cleanDeep(pipeline) : pipeline;
|
|
2629
|
+
let res = await tenant.database.db
|
|
2630
|
+
?.collection("_activity_")
|
|
2631
|
+
.aggregate(toBson(pipeline), {
|
|
2632
|
+
allowDiskUse: true,
|
|
2633
|
+
})
|
|
2634
|
+
.toArray();
|
|
2635
|
+
return resolve(toJson(res));
|
|
2636
|
+
} catch (err) {
|
|
2637
|
+
return reject(err);
|
|
2638
|
+
}
|
|
2639
|
+
});
|
|
2623
2640
|
},
|
|
2624
2641
|
save: async (tenant: Tenant, activity: activityInput) => {
|
|
2625
2642
|
return await tenant.database.db
|