@mastra/mongodb 1.0.0-beta.8 → 1.0.0-beta.9
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 +40 -0
- package/dist/index.cjs +6 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -16
- package/dist/index.js.map +1 -1
- package/dist/storage/index.d.ts +8 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @mastra/mongodb
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add storage composition to MastraStorage ([#11401](https://github.com/mastra-ai/mastra/pull/11401))
|
|
8
|
+
|
|
9
|
+
`MastraStorage` can now compose storage domains from different adapters. Use it when you need different databases for different purposes - for example, PostgreSQL for memory and workflows, but a different database for observability.
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { MastraStorage } from '@mastra/core/storage';
|
|
13
|
+
import { MemoryPG, WorkflowsPG, ScoresPG } from '@mastra/pg';
|
|
14
|
+
import { MemoryLibSQL } from '@mastra/libsql';
|
|
15
|
+
|
|
16
|
+
// Compose domains from different stores
|
|
17
|
+
const storage = new MastraStorage({
|
|
18
|
+
id: 'composite',
|
|
19
|
+
domains: {
|
|
20
|
+
memory: new MemoryLibSQL({ url: 'file:./local.db' }),
|
|
21
|
+
workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
|
|
22
|
+
scores: new ScoresPG({ connectionString: process.env.DATABASE_URL }),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Breaking changes:**
|
|
28
|
+
- `storage.supports` property no longer exists
|
|
29
|
+
- `StorageSupports` type is no longer exported from `@mastra/core/storage`
|
|
30
|
+
|
|
31
|
+
All stores now support the same features. For domain availability, use `getStore()`:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
const store = await storage.getStore('memory');
|
|
35
|
+
if (store) {
|
|
36
|
+
// domain is available
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [[`3d93a15`](https://github.com/mastra-ai/mastra/commit/3d93a15796b158c617461c8b98bede476ebb43e2), [`efe406a`](https://github.com/mastra-ai/mastra/commit/efe406a1353c24993280ebc2ed61dd9f65b84b26), [`119e5c6`](https://github.com/mastra-ai/mastra/commit/119e5c65008f3e5cfca954eefc2eb85e3bf40da4), [`74e504a`](https://github.com/mastra-ai/mastra/commit/74e504a3b584eafd2f198001c6a113bbec589fd3), [`e33fdbd`](https://github.com/mastra-ai/mastra/commit/e33fdbd07b33920d81e823122331b0c0bee0bb59), [`929f69c`](https://github.com/mastra-ai/mastra/commit/929f69c3436fa20dd0f0e2f7ebe8270bd82a1529), [`8a73529`](https://github.com/mastra-ai/mastra/commit/8a73529ca01187f604b1f3019d0a725ac63ae55f)]:
|
|
41
|
+
- @mastra/core@1.0.0-beta.16
|
|
42
|
+
|
|
3
43
|
## 1.0.0-beta.8
|
|
4
44
|
|
|
5
45
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ var evals = require('@mastra/core/evals');
|
|
|
13
13
|
|
|
14
14
|
// package.json
|
|
15
15
|
var package_default = {
|
|
16
|
-
version: "1.0.0-beta.
|
|
16
|
+
version: "1.0.0-beta.9"};
|
|
17
17
|
var MongoDBFilterTranslator = class extends filter.BaseFilterTranslator {
|
|
18
18
|
getSupportedOperators() {
|
|
19
19
|
return {
|
|
@@ -3042,19 +3042,6 @@ var WorkflowsStorageMongoDB = class _WorkflowsStorageMongoDB extends storage.Wor
|
|
|
3042
3042
|
var MongoDBStore = class extends storage.MastraStorage {
|
|
3043
3043
|
#connector;
|
|
3044
3044
|
stores;
|
|
3045
|
-
get supports() {
|
|
3046
|
-
return {
|
|
3047
|
-
selectByIncludeResourceScope: true,
|
|
3048
|
-
resourceWorkingMemory: true,
|
|
3049
|
-
hasColumn: false,
|
|
3050
|
-
createTable: false,
|
|
3051
|
-
deleteMessages: true,
|
|
3052
|
-
observability: true,
|
|
3053
|
-
indexManagement: false,
|
|
3054
|
-
listScoresBySpan: true,
|
|
3055
|
-
agents: true
|
|
3056
|
-
};
|
|
3057
|
-
}
|
|
3058
3045
|
constructor(config) {
|
|
3059
3046
|
super({ id: config.id, name: "MongoDBStore", disableInit: config.disableInit });
|
|
3060
3047
|
this.#connector = resolveMongoDBConfig(config);
|
|
@@ -3193,7 +3180,12 @@ Example Complex Query:
|
|
|
3193
3180
|
}`;
|
|
3194
3181
|
|
|
3195
3182
|
exports.MONGODB_PROMPT = MONGODB_PROMPT;
|
|
3183
|
+
exports.MemoryStorageMongoDB = MemoryStorageMongoDB;
|
|
3184
|
+
exports.MongoDBAgentsStorage = MongoDBAgentsStorage;
|
|
3196
3185
|
exports.MongoDBStore = MongoDBStore;
|
|
3197
3186
|
exports.MongoDBVector = MongoDBVector;
|
|
3187
|
+
exports.ObservabilityMongoDB = ObservabilityMongoDB;
|
|
3188
|
+
exports.ScoresStorageMongoDB = ScoresStorageMongoDB;
|
|
3189
|
+
exports.WorkflowsStorageMongoDB = WorkflowsStorageMongoDB;
|
|
3198
3190
|
//# sourceMappingURL=index.cjs.map
|
|
3199
3191
|
//# sourceMappingURL=index.cjs.map
|