@mastra/mongodb 1.6.1-alpha.0 → 1.6.1-alpha.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @mastra/mongodb
2
2
 
3
+ ## 1.6.1-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - dependencies updates: ([#10188](https://github.com/mastra-ai/mastra/pull/10188))
8
+ - Updated dependency [`cloudflare@^5.2.0` ↗︎](https://www.npmjs.com/package/cloudflare/v/5.2.0) (from `^4.5.0`, in `dependencies`)
9
+ - Updated dependencies [[`e333b77`](https://github.com/mastra-ai/mastra/commit/e333b77e2d76ba57ccec1818e08cebc1993469ff), [`60a224d`](https://github.com/mastra-ai/mastra/commit/60a224dd497240e83698cfa5bfd02e3d1d854844), [`949b7bf`](https://github.com/mastra-ai/mastra/commit/949b7bfd4e40f2b2cba7fef5eb3f108a02cfe938), [`d084b66`](https://github.com/mastra-ai/mastra/commit/d084b6692396057e83c086b954c1857d20b58a14), [`79c699a`](https://github.com/mastra-ai/mastra/commit/79c699acf3cd8a77e11c55530431f48eb48456e9), [`62757b6`](https://github.com/mastra-ai/mastra/commit/62757b6db6e8bb86569d23ad0b514178f57053f8), [`3d70b0b`](https://github.com/mastra-ai/mastra/commit/3d70b0b3524d817173ad870768f259c06d61bd23), [`3b45a13`](https://github.com/mastra-ai/mastra/commit/3b45a138d09d040779c0aba1edbbfc1b57442d23), [`8127d96`](https://github.com/mastra-ai/mastra/commit/8127d96280492e335d49b244501088dfdd59a8f1)]:
10
+ - @mastra/core@1.18.0-alpha.3
11
+
12
+ ## 1.6.1-alpha.1
13
+
14
+ ### Patch Changes
15
+
16
+ - The internal architecture of observational memory has been refactored. The public API and behavior remain unchanged. ([#14453](https://github.com/mastra-ai/mastra/pull/14453))
17
+
18
+ - Updated dependencies [[`dc514a8`](https://github.com/mastra-ai/mastra/commit/dc514a83dba5f719172dddfd2c7b858e4943d067), [`404fea1`](https://github.com/mastra-ai/mastra/commit/404fea13042181f0b0c73a101392ac87c79ceae2), [`ebf5047`](https://github.com/mastra-ai/mastra/commit/ebf5047e825c38a1a356f10b214c1d4260dfcd8d), [`675f15b`](https://github.com/mastra-ai/mastra/commit/675f15b7eaeea649158d228ea635be40480c584d), [`b174c63`](https://github.com/mastra-ai/mastra/commit/b174c63a093108d4e53b9bc89a078d9f66202b3f), [`eef7cb2`](https://github.com/mastra-ai/mastra/commit/eef7cb2abe7ef15951e2fdf792a5095c6c643333), [`e8a5b0b`](https://github.com/mastra-ai/mastra/commit/e8a5b0b9bc94d12dee4150095512ca27a288d778)]:
19
+ - @mastra/core@1.18.0-alpha.0
20
+
3
21
  ## 1.6.1-alpha.0
4
22
 
5
23
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-mongodb
3
3
  description: Documentation for @mastra/mongodb. Use when working with @mastra/mongodb APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/mongodb"
6
- version: "1.6.1-alpha.0"
6
+ version: "1.6.1-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.1-alpha.0",
2
+ "version": "1.6.1-alpha.2",
3
3
  "package": "@mastra/mongodb",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -14,7 +14,7 @@ var evals = require('@mastra/core/evals');
14
14
 
15
15
  // package.json
16
16
  var package_default = {
17
- version: "1.6.1-alpha.0"};
17
+ version: "1.6.1-alpha.2"};
18
18
  var MongoDBFilterTranslator = class extends filter.BaseFilterTranslator {
19
19
  getSupportedOperators() {
20
20
  return {
@@ -3039,6 +3039,42 @@ var MongoDBExperimentsStorage = class _MongoDBExperimentsStorage extends storage
3039
3039
  }
3040
3040
  }
3041
3041
  // -------------------------------------------------------------------------
3042
+ // Aggregation
3043
+ // -------------------------------------------------------------------------
3044
+ async getReviewSummary() {
3045
+ try {
3046
+ const collection = await this.getCollection(storage.TABLE_EXPERIMENT_RESULTS);
3047
+ const pipeline = [
3048
+ {
3049
+ $group: {
3050
+ _id: "$experimentId",
3051
+ total: { $sum: 1 },
3052
+ needsReview: { $sum: { $cond: [{ $eq: ["$status", "needs-review"] }, 1, 0] } },
3053
+ reviewed: { $sum: { $cond: [{ $eq: ["$status", "reviewed"] }, 1, 0] } },
3054
+ complete: { $sum: { $cond: [{ $eq: ["$status", "complete"] }, 1, 0] } }
3055
+ }
3056
+ }
3057
+ ];
3058
+ const results = await collection.aggregate(pipeline).toArray();
3059
+ return results.map((row) => ({
3060
+ experimentId: row._id,
3061
+ total: Number(row.total ?? 0),
3062
+ needsReview: Number(row.needsReview ?? 0),
3063
+ reviewed: Number(row.reviewed ?? 0),
3064
+ complete: Number(row.complete ?? 0)
3065
+ }));
3066
+ } catch (error$1) {
3067
+ throw new error.MastraError(
3068
+ {
3069
+ id: storage.createStorageErrorId("MONGODB", "GET_REVIEW_SUMMARY", "FAILED"),
3070
+ domain: error.ErrorDomain.STORAGE,
3071
+ category: error.ErrorCategory.THIRD_PARTY
3072
+ },
3073
+ error$1
3074
+ );
3075
+ }
3076
+ }
3077
+ // -------------------------------------------------------------------------
3042
3078
  // Cleanup
3043
3079
  // -------------------------------------------------------------------------
3044
3080
  async dangerouslyClearAll() {