@mastra/mongodb 1.18.1 → 1.18.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 +22 -0
- package/dist/docs/SKILL.md +2 -2
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-semantic-recall.md +19 -0
- package/dist/docs/references/docs-storage.md +2 -0
- package/dist/docs/references/integrations-databases-mongodb.md +1 -1
- package/dist/docs/references/reference-rag-vector-databases.md +4 -4
- package/dist/docs/references/reference-vectors-mongodb.md +11 -11
- package/dist/index.cjs +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts +3 -1
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/dist/storage/domains/experiments/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { MessageList } from "@mastra/core/agent";
|
|
|
9
9
|
import { saveScorePayloadSchema } from "@mastra/core/evals";
|
|
10
10
|
import { skillSnapshotFieldValuesEqual } from "@mastra/core/storage/domains/skills";
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.18.
|
|
12
|
+
var version = "1.18.2";
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/vector/filter.ts
|
|
15
15
|
/**
|
|
@@ -2334,7 +2334,7 @@ var BackgroundTasksStorageMongoDB = class BackgroundTasksStorageMongoDB extends
|
|
|
2334
2334
|
async createTask(task) {
|
|
2335
2335
|
await (await this.getCollection()).insertOne(toDoc(task));
|
|
2336
2336
|
}
|
|
2337
|
-
async updateTask(taskId, update) {
|
|
2337
|
+
async updateTask(taskId, update, options) {
|
|
2338
2338
|
const $set = {};
|
|
2339
2339
|
if ("status" in update) $set.status = update.status;
|
|
2340
2340
|
if ("result" in update) $set.result = update.result ?? null;
|
|
@@ -2344,8 +2344,11 @@ var BackgroundTasksStorageMongoDB = class BackgroundTasksStorageMongoDB extends
|
|
|
2344
2344
|
if ("startedAt" in update) $set.startedAt = update.startedAt?.toISOString() ?? null;
|
|
2345
2345
|
if ("suspendedAt" in update) $set.suspendedAt = update.suspendedAt?.toISOString() ?? null;
|
|
2346
2346
|
if ("completedAt" in update) $set.completedAt = update.completedAt?.toISOString() ?? null;
|
|
2347
|
-
if (Object.keys($set).length === 0) return;
|
|
2348
|
-
await (await this.getCollection()).updateOne({
|
|
2347
|
+
if (Object.keys($set).length === 0) return false;
|
|
2348
|
+
return (await (await this.getCollection()).updateOne({
|
|
2349
|
+
id: taskId,
|
|
2350
|
+
...options?.expectedStatus ? { status: options.expectedStatus } : {}
|
|
2351
|
+
}, { $set })).matchedCount > 0;
|
|
2349
2352
|
}
|
|
2350
2353
|
async getTask(taskId) {
|
|
2351
2354
|
const doc = await (await this.getCollection()).findOne({ id: taskId });
|
|
@@ -3703,6 +3706,7 @@ function transformExperimentResultRow(row) {
|
|
|
3703
3706
|
input: parseJsonField(row.input),
|
|
3704
3707
|
output: parseJsonField(row.output) ?? null,
|
|
3705
3708
|
groundTruth: parseJsonField(row.groundTruth) ?? null,
|
|
3709
|
+
metadata: parseJsonField(row.metadata) ?? null,
|
|
3706
3710
|
error: parseJsonField(row.error) ?? null,
|
|
3707
3711
|
startedAt: toDate(row.startedAt),
|
|
3708
3712
|
completedAt: toDate(row.completedAt),
|
|
@@ -4086,6 +4090,7 @@ var MongoDBExperimentsStorage = class MongoDBExperimentsStorage extends Experime
|
|
|
4086
4090
|
input: input.input,
|
|
4087
4091
|
output: input.output ?? null,
|
|
4088
4092
|
groundTruth: input.groundTruth ?? null,
|
|
4093
|
+
metadata: input.metadata ?? null,
|
|
4089
4094
|
error: input.error ?? null,
|
|
4090
4095
|
startedAt: input.startedAt,
|
|
4091
4096
|
completedAt: input.completedAt,
|
|
@@ -4109,6 +4114,7 @@ var MongoDBExperimentsStorage = class MongoDBExperimentsStorage extends Experime
|
|
|
4109
4114
|
input: input.input,
|
|
4110
4115
|
output: input.output ?? null,
|
|
4111
4116
|
groundTruth: input.groundTruth ?? null,
|
|
4117
|
+
metadata: input.metadata ?? null,
|
|
4112
4118
|
error: input.error ?? null,
|
|
4113
4119
|
startedAt: input.startedAt,
|
|
4114
4120
|
completedAt: input.completedAt,
|
|
@@ -4144,6 +4150,7 @@ var MongoDBExperimentsStorage = class MongoDBExperimentsStorage extends Experime
|
|
|
4144
4150
|
input: input.input,
|
|
4145
4151
|
output: input.output ?? null,
|
|
4146
4152
|
groundTruth: input.groundTruth ?? null,
|
|
4153
|
+
metadata: input.metadata ?? null,
|
|
4147
4154
|
error: input.error ?? null,
|
|
4148
4155
|
startedAt: input.startedAt,
|
|
4149
4156
|
completedAt: input.completedAt,
|