Describe the Bug
i'm trying to use mongo vector feature, but it doesn't work.
"@mastra/ai-sdk": "^1.0.0-beta.12",
"@mastra/core": "^1.0.0-beta.19",
"@mastra/fastembed": "^1.0.0-beta.2",
"@mastra/memory": "^1.0.0-beta.10",
"@mastra/mongodb": "^1.0.0-beta.9",
Steps To Reproduce
import { MongoDBStore, MongoDBVector } from '@mastra/mongodb'
console.log('MONGO_URL_MASTRA:', process.env.MONGO_URL_MASTRA)
console.log('MONGO_DATABASE_MASTRA:', process.env.MONGO_DATABASE_MASTRA)
console.log(MongoDBVector)
export const storage = new MongoDBStore({
id: 'mastra',
url: process.env.MONGO_URL_MASTRA,
dbName: process.env.MONGO_DATABASE_MASTRA
})
export const vectorStorage = new MongoDBVector({
id: 'atlas',
url: process.env.MONGO_URL_MASTRA,
dbName: process.env.MONGO_DATABASE_MASTRA
})
await vectorStorage.createIndex({
indexName: 'atlas_embeddings',
dimension: 1536
})
MONGO_URL_MASTRA: mongodb://localhost:27017/?directConnection=true
MONGO_DATABASE_MASTRA: vortexis-studio
[class MongoDBVector extends MastraVector]
⨯ TypeError: Cannot read properties of undefined (reading 'startsWith')
at <unknown> (src/mastra/storage.js:13:30)
11 | })
12 |
> 13 | export const vectorStorage = new MongoDBVector({
| ^
14 | id: 'atlas',
15 | url: process.env.MONGO_URL_MASTRA,
16 | dbName: process.env.MONGO_DATABASE_MASTRA {
Link to Minimal Reproducible Example
https://github.com/mastra-ai/mastra
Expected Behavior
using mongo
Environment Information
"@mastra/ai-sdk": "^1.0.0-beta.12",
"@mastra/core": "^1.0.0-beta.19",
"@mastra/fastembed": "^1.0.0-beta.2",
"@mastra/memory": "^1.0.0-beta.10",
"@mastra/mongodb": "^1.0.0-beta.9",
Verification
Describe the Bug
i'm trying to use mongo vector feature, but it doesn't work.
Steps To Reproduce
Link to Minimal Reproducible Example
https://github.com/mastra-ai/mastra
Expected Behavior
using mongo
Environment Information
Verification