Back to Clickhouse

MongoDB dictionary source

docs/en/sql-reference/statements/create/dictionary/sources/mongodb.md

26.4.1.1-new1.5 KB
Original Source

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

Example of settings:

<Tabs> <TabItem value="ddl" label="DDL" default>
sql
SOURCE(MONGODB(
    host 'localhost'
    port 27017
    user ''
    password ''
    db 'test'
    collection 'dictionary_source'
    options 'ssl=true'
))

Or using a URI:

sql
SOURCE(MONGODB(
    uri 'mongodb://localhost:27017/clickhouse'
    collection 'dictionary_source'
))
</TabItem> <TabItem value="xml" label="Configuration file">
xml
<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
<source>
    <mongodb>
        <uri>mongodb://localhost:27017/test?ssl=true</uri>
        <collection>dictionary_source</collection>
    </mongodb>
</source>
</TabItem> </Tabs>

Setting fields:

SettingDescription
hostThe MongoDB host.
portThe port on the MongoDB server.
userName of the MongoDB user.
passwordPassword of the MongoDB user.
dbName of the database.
collectionName of the collection.
optionsMongoDB connection string options. Optional.
uriURI for establishing the connection (alternative to individual host/port/db fields).

More information about the engine