> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MongoDB dictionary source

> Configure MongoDB as a dictionary source in ClickHouse.

Example of settings:

<Tabs>
  <Tab title="DDL">
    ```sql theme={null}
    SOURCE(MONGODB(
        host 'localhost'
        port 27017
        user ''
        password ''
        db 'test'
        collection 'dictionary_source'
        options 'ssl=true'
    ))
    ```

    Or using a URI:

    ```sql theme={null}
    SOURCE(MONGODB(
        uri 'mongodb://localhost:27017/clickhouse'
        collection 'dictionary_source'
    ))
    ```
  </Tab>

  <Tab title="Configuration file">
    ```xml theme={null}
    <source>
        <mongodb>
            <host>localhost</host>
            <port>27017</port>
            <user></user>
            <password></password>
            <db>test</db>
            <collection>dictionary_source</collection>
            <options>ssl=true</options>
        </mongodb>
    </source>
    ```

    Or using a URI:

    ```xml theme={null}
    <source>
        <mongodb>
            <uri>mongodb://localhost:27017/test?ssl=true</uri>
            <collection>dictionary_source</collection>
        </mongodb>
    </source>
    ```
  </Tab>
</Tabs>

<br />

Setting fields:

| Setting      | Description                                                                          |
| ------------ | ------------------------------------------------------------------------------------ |
| `host`       | The MongoDB host.                                                                    |
| `port`       | The port on the MongoDB server.                                                      |
| `user`       | Name of the MongoDB user.                                                            |
| `password`   | Password of the MongoDB user.                                                        |
| `db`         | Name of the database.                                                                |
| `collection` | Name of the collection.                                                              |
| `options`    | MongoDB connection string options. Optional.                                         |
| `uri`        | URI for establishing the connection (alternative to individual host/port/db fields). |

[More information about the engine](/reference/engines/table-engines/integrations/mongodb)
