@mastra/mongodb 1.14.0 → 1.15.0-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 +78 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-rag-vector-databases.md +17 -0
- package/dist/docs/references/reference-vectors-mongodb.md +185 -4
- package/dist/index.cjs +10781 -11486
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10778 -11482
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts +265 -2
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +10 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAmB,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAEL,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAmB,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAEL,aAAa,EASd,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,oCAAoC,EACpC,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EAExB,yBAAyB,EACzB,iCAAiC,EAEjC,8BAA8B,EAC9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E,+BAA+B,GAAG,OAAO,CAAC,yBAAyB,CAAC;IA0EtG,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BnE,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BjE,2BAA2B,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuC3G,0BAA0B,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC3E,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBpF,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8CtE,+BAA+B,CAAC,KAAK,EAAE,oCAAoC,GAAG,OAAO,CAAC,IAAI,CAAC;IAyC3F,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,GAAG,OAAO,CAAC,IAAI,CAAC;IA4DjF,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAoM3F,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC;IA+D7E,8BAA8B,CAAC,KAAK,EAAE,mCAAmC,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAgFrH"}
|
package/dist/vector/index.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ export interface MongoDBQueryVectorParams extends QueryVectorParams<MongoDBVecto
|
|
|
14
14
|
* See: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/
|
|
15
15
|
*/
|
|
16
16
|
numCandidates?: number;
|
|
17
|
+
/**
|
|
18
|
+
* `'field'` (default) projects the managed `metadata`/`document` fields.
|
|
19
|
+
* `'document'` returns the full source document as `metadata` — use for
|
|
20
|
+
* bring-your-own operational collections whose documents have their own shape.
|
|
21
|
+
*/
|
|
22
|
+
metadataMode?: 'field' | 'document';
|
|
17
23
|
}
|
|
18
24
|
export interface MongoDBCreateIndexParams extends CreateIndexParams {
|
|
19
25
|
/**
|
|
@@ -27,6 +33,25 @@ export interface MongoDBCreateIndexParams extends CreateIndexParams {
|
|
|
27
33
|
* @see https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/
|
|
28
34
|
*/
|
|
29
35
|
filterFields?: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Store the vectors on an existing (operational) collection instead of a
|
|
38
|
+
* managed collection named after the index. Defaults to `indexName`.
|
|
39
|
+
* The collection is never created or dropped by this store when set.
|
|
40
|
+
*/
|
|
41
|
+
collectionName?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Name for the Atlas vectorSearch index created on the collection.
|
|
44
|
+
* Defaults to `${indexName}_vector_index`.
|
|
45
|
+
*/
|
|
46
|
+
searchIndexName?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Opt-in to write operations (`upsert`, `updateVector`, `deleteVector`,
|
|
49
|
+
* `deleteVectors`) on a bring-your-own collection. Defaults to `false`:
|
|
50
|
+
* a BYO index is **read-only** — the store never mutates the caller's
|
|
51
|
+
* operational documents unless explicitly allowed. Ignored for managed
|
|
52
|
+
* collections (which the store owns and can always write to).
|
|
53
|
+
*/
|
|
54
|
+
allowWrites?: boolean;
|
|
30
55
|
}
|
|
31
56
|
export interface MongoDBVectorConfig {
|
|
32
57
|
/** Unique identifier for this vector store instance */
|
|
@@ -63,6 +88,31 @@ export declare class MongoDBVector extends MastraVector<MongoDBVectorFilter> {
|
|
|
63
88
|
* `_id` is excluded because it is materialised separately by the fallback path.
|
|
64
89
|
*/
|
|
65
90
|
private declaredFilterPaths;
|
|
91
|
+
/**
|
|
92
|
+
* Per-index target: where the data lives, what the Atlas index is called, and whether
|
|
93
|
+
* the collection is caller-owned (bring-your-own). `isByo` is captured at createIndex
|
|
94
|
+
* time — it cannot be reliably re-derived from names later (a BYO index may legitimately
|
|
95
|
+
* reuse its indexName as the collectionName), and misclassifying it risks dropping a
|
|
96
|
+
* caller's operational collection in deleteIndex.
|
|
97
|
+
*
|
|
98
|
+
* This is an in-process cache in front of the durable registry collection
|
|
99
|
+
* ({@link MongoDBVector.REGISTRY_COLLECTION}). It is populated at createIndex time and
|
|
100
|
+
* lazily hydrated from the registry by {@link resolveIndexTarget} in any other process,
|
|
101
|
+
* so BYO classification (and thus deleteIndex safety) survives a restart.
|
|
102
|
+
*/
|
|
103
|
+
private indexTargets;
|
|
104
|
+
/**
|
|
105
|
+
* Memoized result of the one-time `$rankFusion` support probe (a `buildInfo` round trip).
|
|
106
|
+
* Cached on the instance after the first `hybridQuery` so subsequent calls skip the admin
|
|
107
|
+
* command; `version` is retained for the unsupported-version error message.
|
|
108
|
+
*/
|
|
109
|
+
private rankFusionSupport?;
|
|
110
|
+
/**
|
|
111
|
+
* Name of the mastra-owned collection that durably records the logical-index → target
|
|
112
|
+
* mapping (`_id: <indexName>`). Kept separate from caller data so a BYO operational
|
|
113
|
+
* collection is never polluted with mastra bookkeeping. Excluded from `listIndexes`.
|
|
114
|
+
*/
|
|
115
|
+
private static readonly REGISTRY_COLLECTION;
|
|
66
116
|
/**
|
|
67
117
|
* MongoDB query operators supported inside `$vectorSearch.filter`. Intentionally
|
|
68
118
|
* conservative: filters using any operator outside this set fall back to the
|
|
@@ -72,6 +122,100 @@ export declare class MongoDBVector extends MastraVector<MongoDBVectorFilter> {
|
|
|
72
122
|
private static readonly PUSHDOWN_OPERATORS;
|
|
73
123
|
private mongoMetricMap;
|
|
74
124
|
constructor({ id, uri, dbName, options, embeddingFieldPath }: MongoDBVectorConfig);
|
|
125
|
+
/**
|
|
126
|
+
* Resolve the collection + vector-index names for an index, honoring BYO overrides.
|
|
127
|
+
*
|
|
128
|
+
* Resolution order:
|
|
129
|
+
* 1. in-process cache ({@link indexTargets}),
|
|
130
|
+
* 2. durable registry collection ({@link MongoDBVector.REGISTRY_COLLECTION}) — hydrated
|
|
131
|
+
* into the cache so BYO routing/classification survives a process restart,
|
|
132
|
+
* 3. managed-index default (`collectionName: indexName`, `isByo: false`) for back-compat
|
|
133
|
+
* with indexes created before the registry existed.
|
|
134
|
+
*
|
|
135
|
+
* Async because the registry read is a MongoDB round-trip; all 13 call sites are inside
|
|
136
|
+
* async methods so awaiting is free.
|
|
137
|
+
*/
|
|
138
|
+
private resolveIndexTarget;
|
|
139
|
+
/**
|
|
140
|
+
* True when another logical index (a different registry `_id`) on the same collection
|
|
141
|
+
* references `physicalIndexName` as its vector or text search index. Used by deleteIndex
|
|
142
|
+
* to preserve a shared Atlas index that a sibling logical index still depends on
|
|
143
|
+
* (e.g. two BYO logical indexes on one collection sharing the default dynamic text index).
|
|
144
|
+
*/
|
|
145
|
+
private isIndexNameReferencedElsewhere;
|
|
146
|
+
/**
|
|
147
|
+
* Reject metadata containing circular references BEFORE it reaches the driver.
|
|
148
|
+
*
|
|
149
|
+
* bson@7.x's iterative `calculateObjectSize` (used by `bulkWrite`) has no cycle
|
|
150
|
+
* detection and spins forever on circular input — it does not throw, it hangs the
|
|
151
|
+
* process at 100% CPU (reproduced standalone against bson 7.3.1). A pre-flight
|
|
152
|
+
* check converts that hang into a clear USER error. Shared references (DAGs) are
|
|
153
|
+
* legal BSON and are allowed; only true ancestor cycles are rejected.
|
|
154
|
+
*/
|
|
155
|
+
private assertNoCircularReferences;
|
|
156
|
+
/**
|
|
157
|
+
* Guard for write operations. A bring-your-own collection is READ-ONLY by default:
|
|
158
|
+
* the caller owns those documents, and Mastra must never mutate or delete them
|
|
159
|
+
* unless the caller explicitly opted in via `createIndex({ ..., allowWrites: true })`.
|
|
160
|
+
* Managed collections (store-owned) are always writable. See mastra-ai/mastra#19802
|
|
161
|
+
* for the design discussion.
|
|
162
|
+
*/
|
|
163
|
+
private assertWritable;
|
|
164
|
+
/**
|
|
165
|
+
* Resolve the full-text (BM25) search index name for an index, honoring a persisted override.
|
|
166
|
+
*
|
|
167
|
+
* A managed index always has a companion dynamic full-text index (auto-created by
|
|
168
|
+
* createIndex), so its name defaults to `${collectionName}_search_index`. A bring-your-own
|
|
169
|
+
* index does NOT get an auto-created full-text index; until the caller opts in via
|
|
170
|
+
* createSearchIndex there is no text index to target, so textQuery/hybridQuery fail clearly
|
|
171
|
+
* here instead of querying a non-existent Atlas index.
|
|
172
|
+
*/
|
|
173
|
+
private resolveTextSearchIndexName;
|
|
174
|
+
/** Read a logical-index target from the durable registry collection, if present. */
|
|
175
|
+
private readRegistryEntry;
|
|
176
|
+
/**
|
|
177
|
+
* Persist (upsert) a logical-index target so it survives a process restart. Idempotent
|
|
178
|
+
* createIndex refreshes it; a partial update (e.g. only the text-search-index name) merges
|
|
179
|
+
* into the existing entry.
|
|
180
|
+
*/
|
|
181
|
+
private writeRegistryEntry;
|
|
182
|
+
/** Remove a logical-index target from the durable registry (called by deleteIndex). */
|
|
183
|
+
private deleteRegistryEntry;
|
|
184
|
+
/**
|
|
185
|
+
* $rankFusion is available in MongoDB >= 8.0. It is generally available from 8.1; on 8.0.x it
|
|
186
|
+
* may require a MongoDB support case to enable (see the $rankFusion docs), but where enabled —
|
|
187
|
+
* e.g. Atlas 8.0.x clusters — it runs. We therefore gate at >= 8.0 (rejecting only clearly
|
|
188
|
+
* unsupported older servers) and let the server be the final authority: if $rankFusion is not
|
|
189
|
+
* actually enabled on an 8.0.x deployment, the query itself surfaces the server error.
|
|
190
|
+
*/
|
|
191
|
+
private assertRankFusionSupported;
|
|
192
|
+
/**
|
|
193
|
+
* Builds the projection pipeline stage(s) for query results based on metadata mode and
|
|
194
|
+
* whether to include vectors. Shared across query, textQuery, and hybridQuery to keep
|
|
195
|
+
* projection logic DRY. Returns an array of stages because `metadataMode: 'document'` may
|
|
196
|
+
* append a `$unset` to strip the embedding from `metadata`.
|
|
197
|
+
*
|
|
198
|
+
* The relevance score is computed here via `$meta: <scoreMeta>` INSIDE the projection
|
|
199
|
+
* rather than by a preceding `$set { score }` stage. This is deliberate: in
|
|
200
|
+
* `metadataMode: 'document'`, `metadata: '$$ROOT'` copies the source document, and if the
|
|
201
|
+
* synthetic score had been `$set` onto the root first, it would (a) leak into `metadata`
|
|
202
|
+
* and (b) clobber any real source field named `score`. Because `$$ROOT` here is the stage
|
|
203
|
+
* input (before this projection materialises `score`), `metadata` is the clean source doc
|
|
204
|
+
* and a real `score` field survives, while the top-level result still carries the synthetic
|
|
205
|
+
* relevance score.
|
|
206
|
+
*
|
|
207
|
+
* **Embedding in document mode:** `metadata: '$$ROOT'` copies the full source document,
|
|
208
|
+
* which includes the (large) embedding field — payload bloat callers rarely want. So when
|
|
209
|
+
* `includeVector` is false, a trailing `$unset` drops the embedding path from `metadata`.
|
|
210
|
+
* `$unset` accepts a dot path, so a nested `embeddingFieldName` (e.g. `text.contentEmbedding`)
|
|
211
|
+
* is handled. When `includeVector` is true, the embedding is retained in `metadata` AND
|
|
212
|
+
* exposed via the top-level `vector` field. Field mode's `metadata` is the managed
|
|
213
|
+
* subdocument, which never contains the embedding, so no `$unset` is needed there.
|
|
214
|
+
*
|
|
215
|
+
* @param scoreMeta - metadata field holding the relevance score for the search stage in use
|
|
216
|
+
* (`vectorSearchScore` for $vectorSearch, `searchScore` for $search, `score` for $rankFusion).
|
|
217
|
+
*/
|
|
218
|
+
private buildProjection;
|
|
75
219
|
connect(): Promise<void>;
|
|
76
220
|
disconnect(): Promise<void>;
|
|
77
221
|
/**
|
|
@@ -85,13 +229,82 @@ export declare class MongoDBVector extends MastraVector<MongoDBVectorFilter> {
|
|
|
85
229
|
* queryable. Skipping that step on a real Atlas cluster may cause
|
|
86
230
|
* "index not found" or "index not ready" errors on subsequent operations.
|
|
87
231
|
*/
|
|
88
|
-
createIndex({ indexName, dimension, metric, filterFields, }: MongoDBCreateIndexParams): Promise<void>;
|
|
232
|
+
createIndex({ indexName, dimension, metric, filterFields, collectionName, searchIndexName, allowWrites, }: MongoDBCreateIndexParams): Promise<void>;
|
|
89
233
|
/**
|
|
90
234
|
* Creates an Atlas Search index, treating IndexAlreadyExists as a no-op so
|
|
91
235
|
* `createIndex` stays idempotent per index. Returns true when the index was
|
|
92
236
|
* actually created by this call.
|
|
93
237
|
*/
|
|
94
238
|
private createSearchIndexIgnoringExisting;
|
|
239
|
+
/**
|
|
240
|
+
* Drop an Atlas Search index, treating "index not found" as a no-op so deleteIndex is
|
|
241
|
+
* retry-safe: an index a prior (interrupted) delete already removed does not fail the retry
|
|
242
|
+
* that still needs to clear the registry entry.
|
|
243
|
+
*/
|
|
244
|
+
private dropSearchIndexIgnoringMissing;
|
|
245
|
+
/**
|
|
246
|
+
* Provision an Atlas Search (BM25/full-text) index on the index's collection and record
|
|
247
|
+
* it as the text-search index that `textQuery`/`hybridQuery` will target.
|
|
248
|
+
*
|
|
249
|
+
* `fields` restricts the mapping to specific paths; omit for dynamic mapping.
|
|
250
|
+
*
|
|
251
|
+
* **Interaction with the auto-created dynamic index:** `createIndex` already provisions a
|
|
252
|
+
* *dynamic* full-text index named `${collectionName}_search_index`. Calling
|
|
253
|
+
* `createSearchIndex` with the default name and a `fields` mapping would hit
|
|
254
|
+
* `IndexAlreadyExists` and silently keep the dynamic mapping. To make `fields` take effect,
|
|
255
|
+
* when `fields` is provided and no explicit `searchIndexName` is given, the field-mapped
|
|
256
|
+
* index is created under a DISTINCT name (`${collectionName}_${indexName}_search_fields_index`,
|
|
257
|
+
* unique per logical index so two logical indexes on one collection do not collide) and
|
|
258
|
+
* persisted as the text-search index, so `textQuery`/`hybridQuery` use the restricted
|
|
259
|
+
* mapping instead of the dynamic one. Pass `searchIndexName` to override the name explicitly.
|
|
260
|
+
*/
|
|
261
|
+
createSearchIndex(params: {
|
|
262
|
+
indexName: string;
|
|
263
|
+
fields?: string[];
|
|
264
|
+
searchIndexName?: string;
|
|
265
|
+
/**
|
|
266
|
+
* When true, block until the provisioned full-text index reports READY (via
|
|
267
|
+
* {@link waitForSearchIndexReady}) before resolving. Defaults to false to avoid surprising
|
|
268
|
+
* latency; call {@link waitForSearchIndexReady} explicitly if you prefer to await separately.
|
|
269
|
+
*/
|
|
270
|
+
waitUntilReady?: boolean;
|
|
271
|
+
}): Promise<void>;
|
|
272
|
+
/**
|
|
273
|
+
* Run a full-text (BM25) search against an Atlas Search index on the collection.
|
|
274
|
+
* The search index is named `${collectionName}_search_index` by default.
|
|
275
|
+
*/
|
|
276
|
+
textQuery(params: {
|
|
277
|
+
indexName: string;
|
|
278
|
+
query: string;
|
|
279
|
+
paths: string[];
|
|
280
|
+
topK?: number;
|
|
281
|
+
filter?: MongoDBVectorFilter;
|
|
282
|
+
metadataMode?: 'field' | 'document';
|
|
283
|
+
/** Override the resolved full-text search index name for this call. */
|
|
284
|
+
searchIndexName?: string;
|
|
285
|
+
}): Promise<QueryResult[]>;
|
|
286
|
+
/**
|
|
287
|
+
* Run a hybrid search that fuses vector similarity and full-text (BM25) results
|
|
288
|
+
* using MongoDB's server-side $rankFusion aggregation stage. Requires MongoDB >= 8.0
|
|
289
|
+
* (see {@link assertRankFusionSupported}: generally available from 8.1; on 8.0.x it may
|
|
290
|
+
* need a MongoDB support case to enable, and runs where enabled, e.g. Atlas 8.0.x).
|
|
291
|
+
*/
|
|
292
|
+
hybridQuery(params: {
|
|
293
|
+
indexName: string;
|
|
294
|
+
queryVector: number[];
|
|
295
|
+
query: string;
|
|
296
|
+
paths: string[];
|
|
297
|
+
topK?: number;
|
|
298
|
+
filter?: MongoDBVectorFilter;
|
|
299
|
+
weights?: {
|
|
300
|
+
vector?: number;
|
|
301
|
+
text?: number;
|
|
302
|
+
};
|
|
303
|
+
numCandidates?: number;
|
|
304
|
+
metadataMode?: 'field' | 'document';
|
|
305
|
+
/** Override the resolved full-text search index name for this call. */
|
|
306
|
+
textSearchIndexName?: string;
|
|
307
|
+
}): Promise<QueryResult[]>;
|
|
95
308
|
/**
|
|
96
309
|
* Waits for the index to be ready.
|
|
97
310
|
*
|
|
@@ -101,6 +314,25 @@ export declare class MongoDBVector extends MastraVector<MongoDBVectorFilter> {
|
|
|
101
314
|
* @returns A promise that resolves when the index is ready
|
|
102
315
|
*/
|
|
103
316
|
waitForIndexReady({ indexName, timeoutMs, checkIntervalMs, }: MongoDBIndexReadyParams): Promise<void>;
|
|
317
|
+
/**
|
|
318
|
+
* Waits for the full-text (BM25) search index of an index to become READY.
|
|
319
|
+
*
|
|
320
|
+
* `waitForIndexReady` polls only the vectorSearch index. `createSearchIndex` returns while the
|
|
321
|
+
* Atlas Search full-text index is still BUILDING, so an immediate textQuery/hybridQuery can
|
|
322
|
+
* intermittently fail. Call this (or pass `waitUntilReady: true` to `createSearchIndex`) to
|
|
323
|
+
* block until the resolved text index reports READY.
|
|
324
|
+
*
|
|
325
|
+
* @param indexName - The logical Mastra index whose text index to wait on.
|
|
326
|
+
* @param searchIndexName - Override the resolved text-search index name.
|
|
327
|
+
* @param timeoutMs - Maximum time to wait (default: 60000).
|
|
328
|
+
* @param checkIntervalMs - Poll interval (default: 2000).
|
|
329
|
+
*/
|
|
330
|
+
waitForSearchIndexReady({ indexName, searchIndexName, timeoutMs, checkIntervalMs, }: {
|
|
331
|
+
indexName: string;
|
|
332
|
+
searchIndexName?: string;
|
|
333
|
+
timeoutMs?: number;
|
|
334
|
+
checkIntervalMs?: number;
|
|
335
|
+
}): Promise<void>;
|
|
104
336
|
/**
|
|
105
337
|
* Inserts or updates vectors in the specified index.
|
|
106
338
|
*
|
|
@@ -132,7 +364,20 @@ export declare class MongoDBVector extends MastraVector<MongoDBVectorFilter> {
|
|
|
132
364
|
* recall at the cost of latency. Defaults to 20 * topK, capped at 10000.
|
|
133
365
|
* @returns Array of results ordered by descending similarity score.
|
|
134
366
|
*/
|
|
135
|
-
query({ indexName, queryVector, topK, filter, includeVector, documentFilter, numCandidates, }: MongoDBQueryVectorParams): Promise<QueryResult[]>;
|
|
367
|
+
query({ indexName, queryVector, topK, filter, includeVector, documentFilter, numCandidates, metadataMode, }: MongoDBQueryVectorParams): Promise<QueryResult[]>;
|
|
368
|
+
/**
|
|
369
|
+
* Lists LOGICAL Mastra index names, not physical collection names.
|
|
370
|
+
*
|
|
371
|
+
* Returns the union of:
|
|
372
|
+
* (a) every logical index registered in the durable registry collection (covers BYO
|
|
373
|
+
* indexes, whose physical collection name differs from the index name), and
|
|
374
|
+
* (b) managed collections that carry a `${name}_vector_index` Atlas Search index but have
|
|
375
|
+
* no registry entry — back-compat for managed indexes created before the registry.
|
|
376
|
+
*
|
|
377
|
+
* The registry collection itself and raw BYO operational collections (which appear under
|
|
378
|
+
* their physical names, not their logical index names) are never listed. Returning the
|
|
379
|
+
* logical name is what makes a listIndexes → deleteIndex round-trip classify BYO correctly.
|
|
380
|
+
*/
|
|
136
381
|
listIndexes(): Promise<string[]>;
|
|
137
382
|
/**
|
|
138
383
|
* Retrieves statistics about a vector index.
|
|
@@ -205,6 +450,24 @@ export declare class MongoDBVector extends MastraVector<MongoDBVectorFilter> {
|
|
|
205
450
|
* can't prove safe returns false so the caller uses the `$match` pre-filter.
|
|
206
451
|
*/
|
|
207
452
|
private canPushDownFilter;
|
|
453
|
+
/**
|
|
454
|
+
* Coerce a MongoDB `_id` (string for managed collections, ObjectId for many bring-your-own
|
|
455
|
+
* operational collections) to the string contract of `QueryResult.id`.
|
|
456
|
+
*/
|
|
457
|
+
private idToString;
|
|
458
|
+
/**
|
|
459
|
+
* Build an `_id` match that works for both string-keyed (managed) and ObjectId-keyed (BYO)
|
|
460
|
+
* collections. Managed collections store string `_id`s; BYO operational collections commonly
|
|
461
|
+
* use native ObjectId `_id`s. The incoming `id` is always a string (the QueryResult contract),
|
|
462
|
+
* so match it as-is AND, when it is a valid 24-hex ObjectId, also as `new ObjectId(id)`.
|
|
463
|
+
*
|
|
464
|
+
* Known (accepted) ambiguity: if a collection contains BOTH the string form and the ObjectId
|
|
465
|
+
* form of the same 24-hex id, a single-doc operation (`deleteOne`/`findOneAndUpdate`) matches
|
|
466
|
+
* whichever the server finds first. `_id` values are unique per BSON type but not across
|
|
467
|
+
* types; in practice a collection keys on one type, so this dual-form collision does not
|
|
468
|
+
* occur outside deliberately mixed test data.
|
|
469
|
+
*/
|
|
470
|
+
private buildIdMatch;
|
|
208
471
|
private transformFilter;
|
|
209
472
|
/**
|
|
210
473
|
* Transform metadata field filters to use MongoDB dot notation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAA6C,MAAM,qBAAqB,CAAC;AAC9F,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,kBAAkB,EAA4B,MAAM,SAAS,CAAC;AAI5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB,CAAC,mBAAmB,CAAC;IACtF,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAA6C,MAAM,qBAAqB,CAAC;AAC9F,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,kB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E,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBlE,aAAa,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,mBAAmB,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAoGxG;;;;;;;;;;;;;;;;;;;OAmBG;YACW,aAAa;YAwBb,wBAAwB;IAiBtC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAWlC;;;;;OAKG;YACW,sBAAsB;IAmCpC;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAezB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAIlB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,eAAe;IAMvB;;;;;;;OAOG;IACH,OAAO,CAAC,uBAAuB;IA+D/B;;;;OAIG;IACH,OAAO,CAAC,eAAe;CAYxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mongodb",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0-alpha.1",
|
|
4
4
|
"description": "MongoDB provider for Mastra - includes vector store capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"@vitest/coverage-v8": "4.1.10",
|
|
29
29
|
"@vitest/ui": "4.1.10",
|
|
30
30
|
"eslint": "^10.7.0",
|
|
31
|
-
"
|
|
31
|
+
"tsdown": "0.22.9",
|
|
32
32
|
"tsx": "^4.23.1",
|
|
33
33
|
"typescript": "^6.0.3",
|
|
34
34
|
"vitest": "4.1.10",
|
|
35
|
-
"@internal/lint": "0.0.
|
|
36
|
-
"@internal/types-builder": "0.0.
|
|
37
|
-
"@mastra/core": "1.
|
|
38
|
-
"@internal/storage-test-utils": "0.0.
|
|
35
|
+
"@internal/lint": "0.0.117",
|
|
36
|
+
"@internal/types-builder": "0.0.92",
|
|
37
|
+
"@mastra/core": "1.54.0-alpha.2",
|
|
38
|
+
"@internal/storage-test-utils": "0.0.113"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@mastra/core": ">=1.51.0-0 <2.0.0-0"
|
|
@@ -57,14 +57,15 @@
|
|
|
57
57
|
"node": ">=22.13.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
|
-
"build:lib": "
|
|
61
|
-
"build:watch": "
|
|
60
|
+
"build:lib": "tsdown --silent --config tsdown.config.ts",
|
|
61
|
+
"build:watch": "tsdown --watch --silent --config tsdown.config.ts",
|
|
62
62
|
"pretest": "docker compose up -d --wait || (echo '--- docker compose up failed; dumping diagnostics ---' && docker compose ps -a && docker compose logs && df -h && exit 1)",
|
|
63
63
|
"test": "vitest run",
|
|
64
64
|
"posttest": "docker compose down -v",
|
|
65
65
|
"pretest:watch": "docker compose up -d",
|
|
66
66
|
"test:watch": "vitest watch",
|
|
67
67
|
"posttest:watch": "docker compose down -v",
|
|
68
|
-
"lint": "eslint ."
|
|
68
|
+
"lint": "oxlint . && eslint .",
|
|
69
|
+
"lint:fix": "oxlint --fix . && eslint --fix ."
|
|
69
70
|
}
|
|
70
71
|
}
|