Skip to content
Snippets Groups Projects
Unverified Commit 83c24f4d authored by justinmann's avatar justinmann Committed by GitHub
Browse files

cannot pass embedModel to MongoDBAtlasVectorStore (#887)

parent 88326693
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ import type { BulkWriteOptions, Collection } from "mongodb"; ...@@ -3,6 +3,7 @@ import type { BulkWriteOptions, Collection } from "mongodb";
import { MongoClient } from "mongodb"; import { MongoClient } from "mongodb";
import type { BaseNode } from "../../Node.js"; import type { BaseNode } from "../../Node.js";
import { MetadataMode } from "../../Node.js"; import { MetadataMode } from "../../Node.js";
import { BaseEmbedding } from "../../embeddings/types.js";
import { import {
VectorStoreBase, VectorStoreBase,
type MetadataFilters, type MetadataFilters,
...@@ -44,9 +45,10 @@ export class MongoDBAtlasVectorSearch ...@@ -44,9 +45,10 @@ export class MongoDBAtlasVectorSearch
init: Partial<MongoDBAtlasVectorSearch> & { init: Partial<MongoDBAtlasVectorSearch> & {
dbName: string; dbName: string;
collectionName: string; collectionName: string;
embedModel?: BaseEmbedding;
}, },
) { ) {
super(); super(init.embedModel);
if (init.mongodbClient) { if (init.mongodbClient) {
this.mongodbClient = init.mongodbClient; this.mongodbClient = init.mongodbClient;
} else { } else {
...@@ -100,7 +102,7 @@ export class MongoDBAtlasVectorSearch ...@@ -100,7 +102,7 @@ export class MongoDBAtlasVectorSearch
} }
async delete(refDocId: string, deleteOptions?: any): Promise<void> { async delete(refDocId: string, deleteOptions?: any): Promise<void> {
await this.collection.deleteOne( await this.collection.deleteMany(
{ {
[`${this.metadataKey}.ref_doc_id`]: refDocId, [`${this.metadataKey}.ref_doc_id`]: refDocId,
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment