@mastra/mongodb 0.11.1-alpha.0 → 0.11.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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/mongodb@0.11.1-alpha.0 build /home/runner/work/mastra/mastra/stores/mongodb
2
+ > @mastra/mongodb@0.11.1-alpha.2 build /home/runner/work/mastra/mastra/stores/mongodb
3
3
  > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.5.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 8959ms
9
+ TSC ⚡️ Build success in 10005ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/stores/mongodb/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/mongodb/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 12741ms
16
+ DTS ⚡️ Build success in 11238ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- CJS dist/index.cjs 34.22 KB
21
- CJS ⚡️ Build success in 1124ms
22
- ESM dist/index.js 34.09 KB
23
- ESM ⚡️ Build success in 1126ms
20
+ ESM dist/index.js 42.52 KB
21
+ ESM ⚡️ Build success in 1306ms
22
+ CJS dist/index.cjs 43.36 KB
23
+ CJS ⚡️ Build success in 1315ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @mastra/mongodb
2
2
 
3
+ ## 0.11.1-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a2eceb2: fix: mongo storage trace query
8
+ - 0fb9d64: [MASTRA-4018] Update saveMessages in storage adapters to upsert messages
9
+ - 870f156: Parse eval result
10
+ - 144eb0b: [MASTRA-3669] Metadata Filter Types
11
+ - Updated dependencies [15e9d26]
12
+ - Updated dependencies [07d6d88]
13
+ - Updated dependencies [5d74aab]
14
+ - Updated dependencies [144eb0b]
15
+ - @mastra/core@0.10.7-alpha.2
16
+
17
+ ## 0.11.1-alpha.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 2097952: [MASTRA-4021] Fix PG getMessages and update messageLimit for all storage adapters
22
+ - 0e17048: Throw mastra errors in storage packages
23
+ - Updated dependencies [d1baedb]
24
+ - Updated dependencies [4d21bf2]
25
+ - Updated dependencies [2097952]
26
+ - Updated dependencies [4fb0cc2]
27
+ - Updated dependencies [d2a7a31]
28
+ - Updated dependencies [0e17048]
29
+ - @mastra/core@0.10.7-alpha.1
30
+
3
31
  ## 0.11.1-alpha.0
4
32
 
5
33
  ### Patch Changes
@@ -1,10 +1,12 @@
1
1
  import { BaseFilterTranslator } from '@mastra/core/vector/filter';
2
+ import type { BlacklistedRootOperators } from '@mastra/core/vector/filter';
2
3
  import type { CreateIndexParams } from '@mastra/core/vector';
3
4
  import type { DeleteIndexParams } from '@mastra/core/vector';
4
5
  import type { DeleteVectorParams } from '@mastra/core/vector';
5
6
  import type { DescribeIndexParams } from '@mastra/core/vector';
6
7
  import type { EvalRow } from '@mastra/core/storage';
7
8
  import type { IndexStats } from '@mastra/core/vector';
9
+ import type { LogicalOperatorValueMap } from '@mastra/core/vector/filter';
8
10
  import type { MastraMessageContentV2 } from '@mastra/core/agent';
9
11
  import type { MastraMessageV1 } from '@mastra/core/memory';
10
12
  import type { MastraMessageV2 } from '@mastra/core/memory';
@@ -12,6 +14,7 @@ import { MastraStorage } from '@mastra/core/storage';
12
14
  import { MastraVector } from '@mastra/core/vector';
13
15
  import type { MongoClientOptions } from 'mongodb';
14
16
  import type { OperatorSupport } from '@mastra/core/vector/filter';
17
+ import type { OperatorValueMap } from '@mastra/core/vector/filter';
15
18
  import type { PaginationInfo } from '@mastra/core/storage';
16
19
  import type { QueryResult } from '@mastra/core/vector';
17
20
  import type { QueryVectorParams } from '@mastra/core/vector';
@@ -23,6 +26,7 @@ import type { TABLE_NAMES } from '@mastra/core/storage';
23
26
  import type { Trace } from '@mastra/core/telemetry';
24
27
  import type { UpdateVectorParams } from '@mastra/core/vector';
25
28
  import type { UpsertVectorParams } from '@mastra/core/vector';
29
+ import type { VectorFieldValue } from '@mastra/core/vector/filter';
26
30
  import type { VectorFilter } from '@mastra/core/vector/filter';
27
31
  import type { WorkflowRun } from '@mastra/core/storage';
28
32
  import type { WorkflowRunState } from '@mastra/core/workflows';
@@ -35,6 +39,8 @@ declare const MONGODB_PROMPT = "When querying MongoDB Vector, you can ONLY use t
35
39
  export { MONGODB_PROMPT }
36
40
  export { MONGODB_PROMPT as MONGODB_PROMPT_alias_1 }
37
41
 
42
+ declare type MongoDBBlacklisted = BlacklistedRootOperators | '$size';
43
+
38
44
  declare interface MongoDBConfig {
39
45
  url: string;
40
46
  dbName: string;
@@ -48,9 +54,9 @@ export { MongoDBConfig as MongoDBConfig_alias_1 }
48
54
  * Maintains MongoDB-compatible syntax while ensuring proper validation
49
55
  * and normalization of values.
50
56
  */
51
- export declare class MongoDBFilterTranslator extends BaseFilterTranslator {
57
+ export declare class MongoDBFilterTranslator extends BaseFilterTranslator<MongoDBVectorFilter> {
52
58
  protected getSupportedOperators(): OperatorSupport;
53
- translate(filter?: VectorFilter): any;
59
+ translate(filter?: MongoDBVectorFilter): any;
54
60
  private translateNode;
55
61
  private translateOperatorValue;
56
62
  isEmpty(filter: any): boolean;
@@ -64,11 +70,13 @@ declare interface MongoDBIndexReadyParams {
64
70
  export { MongoDBIndexReadyParams }
65
71
  export { MongoDBIndexReadyParams as MongoDBIndexReadyParams_alias_1 }
66
72
 
67
- declare interface MongoDBQueryVectorParams extends QueryVectorParams {
68
- documentFilter?: VectorFilter;
73
+ declare type MongoDBOperatorValueMap = Omit<OperatorValueMap, '$options'> & {
74
+ $size: number;
75
+ };
76
+
77
+ declare interface MongoDBQueryVectorParams extends QueryVectorParams<MongoDBVectorFilter> {
78
+ documentFilter?: MongoDBVectorFilter;
69
79
  }
70
- export { MongoDBQueryVectorParams }
71
- export { MongoDBQueryVectorParams as MongoDBQueryVectorParams_alias_1 }
72
80
 
73
81
  declare class MongoDBStore extends MastraStorage {
74
82
  #private;
@@ -207,7 +215,7 @@ declare interface MongoDBUpsertVectorParams extends UpsertVectorParams {
207
215
  export { MongoDBUpsertVectorParams }
208
216
  export { MongoDBUpsertVectorParams as MongoDBUpsertVectorParams_alias_1 }
209
217
 
210
- declare class MongoDBVector extends MastraVector {
218
+ declare class MongoDBVector extends MastraVector<MongoDBVectorFilter> {
211
219
  private client;
212
220
  private db;
213
221
  private collections;
@@ -271,4 +279,6 @@ declare class MongoDBVector extends MastraVector {
271
279
  export { MongoDBVector }
272
280
  export { MongoDBVector as MongoDBVector_alias_1 }
273
281
 
282
+ export declare type MongoDBVectorFilter = VectorFilter<keyof MongoDBOperatorValueMap, MongoDBOperatorValueMap, LogicalOperatorValueMap, MongoDBBlacklisted, VectorFieldValue | RegExp>;
283
+
274
284
  export { }
@@ -1,10 +1,12 @@
1
1
  import { BaseFilterTranslator } from '@mastra/core/vector/filter';
2
+ import type { BlacklistedRootOperators } from '@mastra/core/vector/filter';
2
3
  import type { CreateIndexParams } from '@mastra/core/vector';
3
4
  import type { DeleteIndexParams } from '@mastra/core/vector';
4
5
  import type { DeleteVectorParams } from '@mastra/core/vector';
5
6
  import type { DescribeIndexParams } from '@mastra/core/vector';
6
7
  import type { EvalRow } from '@mastra/core/storage';
7
8
  import type { IndexStats } from '@mastra/core/vector';
9
+ import type { LogicalOperatorValueMap } from '@mastra/core/vector/filter';
8
10
  import type { MastraMessageContentV2 } from '@mastra/core/agent';
9
11
  import type { MastraMessageV1 } from '@mastra/core/memory';
10
12
  import type { MastraMessageV2 } from '@mastra/core/memory';
@@ -12,6 +14,7 @@ import { MastraStorage } from '@mastra/core/storage';
12
14
  import { MastraVector } from '@mastra/core/vector';
13
15
  import type { MongoClientOptions } from 'mongodb';
14
16
  import type { OperatorSupport } from '@mastra/core/vector/filter';
17
+ import type { OperatorValueMap } from '@mastra/core/vector/filter';
15
18
  import type { PaginationInfo } from '@mastra/core/storage';
16
19
  import type { QueryResult } from '@mastra/core/vector';
17
20
  import type { QueryVectorParams } from '@mastra/core/vector';
@@ -23,6 +26,7 @@ import type { TABLE_NAMES } from '@mastra/core/storage';
23
26
  import type { Trace } from '@mastra/core/telemetry';
24
27
  import type { UpdateVectorParams } from '@mastra/core/vector';
25
28
  import type { UpsertVectorParams } from '@mastra/core/vector';
29
+ import type { VectorFieldValue } from '@mastra/core/vector/filter';
26
30
  import type { VectorFilter } from '@mastra/core/vector/filter';
27
31
  import type { WorkflowRun } from '@mastra/core/storage';
28
32
  import type { WorkflowRunState } from '@mastra/core/workflows';
@@ -35,6 +39,8 @@ declare const MONGODB_PROMPT = "When querying MongoDB Vector, you can ONLY use t
35
39
  export { MONGODB_PROMPT }
36
40
  export { MONGODB_PROMPT as MONGODB_PROMPT_alias_1 }
37
41
 
42
+ declare type MongoDBBlacklisted = BlacklistedRootOperators | '$size';
43
+
38
44
  declare interface MongoDBConfig {
39
45
  url: string;
40
46
  dbName: string;
@@ -48,9 +54,9 @@ export { MongoDBConfig as MongoDBConfig_alias_1 }
48
54
  * Maintains MongoDB-compatible syntax while ensuring proper validation
49
55
  * and normalization of values.
50
56
  */
51
- export declare class MongoDBFilterTranslator extends BaseFilterTranslator {
57
+ export declare class MongoDBFilterTranslator extends BaseFilterTranslator<MongoDBVectorFilter> {
52
58
  protected getSupportedOperators(): OperatorSupport;
53
- translate(filter?: VectorFilter): any;
59
+ translate(filter?: MongoDBVectorFilter): any;
54
60
  private translateNode;
55
61
  private translateOperatorValue;
56
62
  isEmpty(filter: any): boolean;
@@ -64,11 +70,13 @@ declare interface MongoDBIndexReadyParams {
64
70
  export { MongoDBIndexReadyParams }
65
71
  export { MongoDBIndexReadyParams as MongoDBIndexReadyParams_alias_1 }
66
72
 
67
- declare interface MongoDBQueryVectorParams extends QueryVectorParams {
68
- documentFilter?: VectorFilter;
73
+ declare type MongoDBOperatorValueMap = Omit<OperatorValueMap, '$options'> & {
74
+ $size: number;
75
+ };
76
+
77
+ declare interface MongoDBQueryVectorParams extends QueryVectorParams<MongoDBVectorFilter> {
78
+ documentFilter?: MongoDBVectorFilter;
69
79
  }
70
- export { MongoDBQueryVectorParams }
71
- export { MongoDBQueryVectorParams as MongoDBQueryVectorParams_alias_1 }
72
80
 
73
81
  declare class MongoDBStore extends MastraStorage {
74
82
  #private;
@@ -207,7 +215,7 @@ declare interface MongoDBUpsertVectorParams extends UpsertVectorParams {
207
215
  export { MongoDBUpsertVectorParams }
208
216
  export { MongoDBUpsertVectorParams as MongoDBUpsertVectorParams_alias_1 }
209
217
 
210
- declare class MongoDBVector extends MastraVector {
218
+ declare class MongoDBVector extends MastraVector<MongoDBVectorFilter> {
211
219
  private client;
212
220
  private db;
213
221
  private collections;
@@ -271,4 +279,6 @@ declare class MongoDBVector extends MastraVector {
271
279
  export { MongoDBVector }
272
280
  export { MongoDBVector as MongoDBVector_alias_1 }
273
281
 
282
+ export declare type MongoDBVectorFilter = VectorFilter<keyof MongoDBOperatorValueMap, MongoDBOperatorValueMap, LogicalOperatorValueMap, MongoDBBlacklisted, VectorFieldValue | RegExp>;
283
+
274
284
  export { }