Install and import from the "@langchain/mongodb" integration package instead. Type that defines the arguments required to initialize the MongoDBAtlasVectorSearch class. It includes the MongoDB collection, index name, text key, embedding key, primary key, and overwrite flag.

MongoDB collection to store the vectors.

A Collections Index Name.

Corresponds to the plaintext of 'pageContent'.

Key to store the embedding under.

The Key to use for upserting documents.

interface MongoDBAtlasVectorSearchLibArgs {
    collection: Collection<Document>;
    embeddingKey?: string;
    indexName?: string;
    maxConcurrency?: number;
    maxRetries?: number;
    onFailedAttempt?: FailedAttemptHandler;
    primaryKey?: string;
    textKey?: string;
}

Hierarchy

  • AsyncCallerParams
    • MongoDBAtlasVectorSearchLibArgs

Properties

collection: Collection<Document>
embeddingKey?: string
indexName?: string
maxConcurrency?: number

The maximum number of concurrent calls that can be made. Defaults to Infinity, which means no limit.

maxRetries?: number

The maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 6.

onFailedAttempt?: FailedAttemptHandler

Custom handler to handle failed attempts. Takes the originally thrown error object as input, and should itself throw an error if the input error is not retryable.

primaryKey?: string
textKey?: string