Skip to main content

MongoDBAtlasVectorDB

A Collection object for MongoDB.
Initialize the vector database.
Parameters:

Class Attributes

active_collection



embedding_function



type



Instance Methods

create_collection

Create a collection in the vector database and create a vector search index in the collection.
Parameters:

create_index_if_not_exists

Creates a vector search index on the specified collection in MongoDB.
Parameters:

create_vector_search_index

Create a vector search index in the collection.
Parameters:

delete_collection

Delete the collection from the vector database.
Parameters:

delete_docs

Delete documents from the collection of the vector database.
Parameters:

get_collection

Get the collection from the vector database.
Parameters: Returns:

get_docs_by_ids

Retrieve documents from the collection of the vector database based on the ids.
Parameters: Returns:

insert_docs

Insert Documents and Vector Embeddings into the collection of the vector database.
For large numbers of Documents, insertion is performed in batches.
Parameters:

list_collections

List the collections in the vector database.
Returns:
List[str] | The list of collections.

retrieve_docs

Retrieve documents from the collection of the vector database based on the queries.
Parameters: Returns:

update_docs

Update documents, including their embeddings, in the Collection.
Optionally allow upsert as kwarg.
Uses deepcopy to avoid changing docs.
Parameters: