DocumentDBVectorSearch(
self,
collection: Collection[DocumentDBDocumentType],
embedding: Embeddings,
*,
index_name:| Name | Type | Description |
|---|---|---|
collection* | Collection[DocumentDBDocumentType] | MongoDB collection to add the texts to. |
embedding* | Embeddings | Text embedding model to use. |
index_name | str | Default: 'vectorSearchIndex'Name of the Vector Search index. |
text_key | str | Default: 'textContent' |
embedding_key | str | Default: 'vectorContent' |
| Name | Type |
|---|---|
| collection | Collection[DocumentDBDocumentType] |
| embedding | Embeddings |
| index_name | str |
| text_key | str |
| embedding_key | str |
Amazon DocumentDB (with MongoDB compatibility) vector store.
Please refer to the official Vector Search documentation for more details:
https://docs.aws.amazon.com/documentdb/latest/developerguide/vector-search.html
To use, you should have both:
pymongo python package installedExample:
. code-block:: python
from langchain_community.vectorstores import DocumentDBVectorSearch from langchain_community.embeddings.openai import OpenAIEmbeddings from pymongo import MongoClient
mongo_client = MongoClient("
MongoDB field that will contain the text for each document.
MongoDB field that will contain the embedding for each document.