@mastra/mongodb 1.7.2-alpha.0 → 1.7.2-alpha.1

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,14 @@
1
1
  # @mastra/mongodb
2
2
 
3
+ ## 1.7.2-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Added `getTraceLight` method to the observability storage, returning only lightweight span fields needed for timeline rendering. This avoids transferring heavy fields like `input`, `output`, `attributes`, and `metadata` when they are not needed. ([#15574](https://github.com/mastra-ai/mastra/pull/15574))
8
+
9
+ - Updated dependencies [[`20f59b8`](https://github.com/mastra-ai/mastra/commit/20f59b876cf91199efbc49a0e36b391240708f08), [`e2687a7`](https://github.com/mastra-ai/mastra/commit/e2687a7408790c384563816a9a28ed06735684c9), [`8f1b280`](https://github.com/mastra-ai/mastra/commit/8f1b280b7fe6999ec654f160cb69c1a8719e7a57), [`12df98c`](https://github.com/mastra-ai/mastra/commit/12df98c4904643d9481f5c78f3bed443725b4c96)]:
10
+ - @mastra/core@1.26.0-alpha.11
11
+
3
12
  ## 1.7.2-alpha.0
4
13
 
5
14
  ### 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.7.2-alpha.0"
6
+ version: "1.7.2-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.2-alpha.0",
2
+ "version": "1.7.2-alpha.1",
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.7.2-alpha.0"};
17
+ version: "1.7.2-alpha.1"};
18
18
  var MongoDBFilterTranslator = class extends filter.BaseFilterTranslator {
19
19
  getSupportedOperators() {
20
20
  return {
@@ -6650,6 +6650,44 @@ Note: This migration may take some time for large collections.
6650
6650
  );
6651
6651
  }
6652
6652
  }
6653
+ async getTraceLight(args) {
6654
+ const { traceId } = args;
6655
+ try {
6656
+ const collection = await this.getCollection(storage.TABLE_SPANS);
6657
+ const spans = await collection.find(
6658
+ { traceId },
6659
+ {
6660
+ projection: {
6661
+ input: 0,
6662
+ output: 0,
6663
+ attributes: 0,
6664
+ metadata: 0,
6665
+ tags: 0,
6666
+ links: 0
6667
+ }
6668
+ }
6669
+ ).sort({ startedAt: 1 }).toArray();
6670
+ if (!spans || spans.length === 0) {
6671
+ return null;
6672
+ }
6673
+ return {
6674
+ traceId,
6675
+ spans: spans.map((span) => this.transformSpanFromMongo(span))
6676
+ };
6677
+ } catch (error$1) {
6678
+ throw new error.MastraError(
6679
+ {
6680
+ id: storage.createStorageErrorId("MONGODB", "GET_TRACE_LIGHT", "FAILED"),
6681
+ domain: error.ErrorDomain.STORAGE,
6682
+ category: error.ErrorCategory.USER,
6683
+ details: {
6684
+ traceId
6685
+ }
6686
+ },
6687
+ error$1
6688
+ );
6689
+ }
6690
+ }
6653
6691
  async updateSpan(args) {
6654
6692
  const { traceId, spanId, updates } = args;
6655
6693
  try {