# CouchbaseLoader

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/document_loaders/couchbase/CouchbaseLoader)

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`.

## Signature

```python
CouchbaseLoader(
    self,
    connection_string: str,
    db_username: str,
    db_password: str,
    query: str,
    *,
    page_content_fields: Optional[List[str]] = None,
    metadata_fields: Optional[List[str]] = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `connection_string` | `str` | Yes | The connection string to the Couchbase cluster. |
| `db_username` | `str` | Yes | The username to connect to the Couchbase cluster. |
| `db_password` | `str` | Yes | The password to connect to the Couchbase cluster. |
| `query` | `str` | Yes | The SQL++ query to execute. |
| `page_content_fields` | `Optional[List[str]]` | No | The columns to write into the `page_content` field of the document. By default, all columns are written. (default: `None`) |
| `metadata_fields` | `Optional[List[str]]` | No | The columns to write into the `metadata` field of the document. By default, no columns are written. (default: `None`) |

## Extends

- `BaseLoader`

## Constructors

```python
__init__(
    self,
    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
```

| Name | Type |
|------|------|
| `connection_string` | `str` |
| `db_username` | `str` |
| `db_password` | `str` |
| `query` | `str` |
| `page_content_fields` | `Optional[List[str]]` |
| `metadata_fields` | `Optional[List[str]]` |


## Properties

- `cluster`
- `query`
- `page_content_fields`
- `metadata_fields`

## Methods

- [`lazy_load()`](https://reference.langchain.com/python/langchain-community/document_loaders/couchbase/CouchbaseLoader/lazy_load)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/document_loaders/couchbase.py#L11)