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.

lazy_load()

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.

lazy_load() Iterator[Document][source]¶

Load Couchbase data into Document objects lazily.

load() List[Document][source]¶

Load Couchbase data into Document objects.

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.