langchain_community.document_loaders.couchbase
.CouchbaseLoaderΒΆ
- class langchain_community.document_loaders.couchbase.CouchbaseLoader(connection_string: str, db_username: str, db_password: str, query: str, *, page_content_fields: Optional[List[str]] = None, metadata_fields: Optional[List[str]] = None)[source]ΒΆ
Load documents from Couchbase.
Each document represents one row of the result. The page_content_fields are written into the page_content`of the document. The `metadata_fields are written into the metadata of the document. By default, all columns are written into the page_content and none into the metadata.
Initialize Couchbase document loader.
- Parameters
connection_string (str) β The connection string to the Couchbase cluster.
db_username (str) β The username to connect to the Couchbase cluster.
db_password (str) β The password to connect to the Couchbase cluster.
query (str) β The SQL++ query to execute.
page_content_fields (Optional[List[str]]) β The columns to write into the page_content field of the document. By default, all columns are written.
metadata_fields (Optional[List[str]]) β The columns to write into the metadata field of the document. By default, no columns are written.
Methods
__init__
(connection_string, db_username, ...)Initialize Couchbase document loader.
Load Couchbase data into Document objects lazily.
load
()Load Couchbase data into Document objects.
load_and_split
([text_splitter])Load Documents and split into chunks.
- __init__(connection_string: str, db_username: str, db_password: str, query: str, *, page_content_fields: Optional[List[str]] = None, metadata_fields: Optional[List[str]] = None) None [source]ΒΆ
Initialize Couchbase document loader.
- Parameters
connection_string (str) β The connection string to the Couchbase cluster.
db_username (str) β The username to connect to the Couchbase cluster.
db_password (str) β The password to connect to the Couchbase cluster.
query (str) β The SQL++ query to execute.
page_content_fields (Optional[List[str]]) β The columns to write into the page_content field of the document. By default, all columns are written.
metadata_fields (Optional[List[str]]) β The columns to write into the metadata field of the document. By default, no columns are written.
- load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document] ΒΆ
Load Documents and split into chunks. Chunks are returned as Documents.
- Parameters
text_splitter β TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns
List of Documents.