Update packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreMongoDBAtlas/VectorStoreMongoDBAtlas.node.ts

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
This commit is contained in:
Pash10g 2025-03-03 12:46:47 +02:00 committed by GitHub
parent ab82336440
commit 77394caf5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -159,7 +159,7 @@ export class VectorStoreMongoDBAtlas extends createVectorStoreNode({
// Check if collection exists
const collections = await db.listCollections({ name: collectionName }).toArray();
if (collections.length === 0) {
db.createCollection(collectionName);
await db.createCollection(collectionName);
}
const collection = db.collection(collectionName);
await MongoDBAtlasVectorSearch.fromDocuments(documents, embeddings, {