<@U04S8PLJWMT> how does airbyte parse mongodb coll...
# ask-ai
s
@kapa.ai how does airbyte parse mongodb collections into push them into clickhouse? JSON or something else?
k
When Airbyte syncs data from MongoDB collections to ClickHouse, the process depends on the configuration and the version of the ClickHouse destination connector: - Data Extraction from MongoDB: Airbyte extracts records from MongoDB as JSON objects. In schema-enforced mode, it maps MongoDB fields to a defined schema; in schema-less mode, it wraps the entire document in a JSON blob under a "data" field. This means the data is fundamentally handled as JSON during extraction from MongoDB [Replication Methods - MongoDB Source](https://docs.airbyte.com/integrations/sources/mongodb-v2#replication-methods). - Loading into ClickHouse (Destination v2): With the modern ClickHouse destination (v2), Airbyte writes data to typed columns matching the source schema. For fields of type "object" (i.e., JSON objects), Airbyte can store them as ClickHouse's native
JSON
type if you enable the "Enable JSON" option in the connector configuration and your ClickHouse version supports it (from 25.3+). If not enabled, or if the server version does not support the JSON type, these fields are stored as strings containing the JSON representation [ClickHouse Output Schema](https://docs.airbyte.com/integrations/destinations/clickhouse#output-schema). So, by default, MongoDB objects are parsed as JSON and either stored as JSON (if enabled and supported) or as strings in ClickHouse. Arrays and unions are also stored as strings, which you can later parse using ClickHouse's JSON functions if needed. Summary: Airbyte parses MongoDB collections as JSON objects and, depending on your ClickHouse destination configuration, stores them in ClickHouse as either native JSON (if supported and enabled) or as JSON-formatted strings [ClickHouse Output Schema](https://docs.airbyte.com/integrations/destinations/clickhouse#output-schema).