from_connection_string(
cls,
connection_string: str,
embedding_model: Embeddings,
child_splitter: TextSplitter,| Name | Type | Description |
|---|---|---|
connection_string* | str | A valid MongoDB Atlas connection URI. |
embedding_model* | Embeddings | The text embedding model to use for the vector store. |
child_splitter* | TextSplitter | Splits documents into chunks. If parent_splitter is given, the documents will have already been split. |
database_name* | str | |
collection_name | str | Default: 'document_with_chunks' |
id_key | str | Default: 'doc_id' |
auto_create_index | bool | Default: True |
auto_index_timeout | int | Default: 15 |
search_index_name | str | Default: 'text_index' |
search_field | Optional[str] | Default: None |
**kwargs | Any | Default: {} |
Construct Retriever using one Collection for VectorStore and one for DocStore
See parent classes
:class:~langchain.retrievers.parent_document_retriever.ParentDocumentRetriever
and :class:~langchain.retrievers.MultiVectorRetriever for further details.
Returns: A new MongoDBAtlasParentDocumentRetriever
Name of database to connect to. Created if it does not exist.
Name of collection to use. It includes parent documents, sub-documents and their embeddings.
Key used to identify parent documents.
Whether to automatically create the full-text search index if it does not exist. Defaults to True.
How long to wait for the automatic index creation to complete, in seconds
Name of the full-text search index to create when auto_create_index is True. Defaults to "text_index".
Field to index for full-text search. Defaults to the vectorstore text key.
Additional keyword arguments. See parent classes for more.