ClickHouse icon indicating copy to clipboard operation
ClickHouse copied to clipboard

To select a json object from mongodb in clickhouse.

Open HitendraSinghRathore opened this issue 9 months ago • 1 comments

I have a nested object in my mongo db table the column is affiliate_bag_details

{
"test": 12,
"obj": {
 "nested": [1,2,4]
}
}

while fetching the same using the function MongoDB

SELECT 
    bag_id, 
    display_name, 
    affiliate_bag_details
FROM mongodb(
    '<IP>:host', 
    'db', 
    'collection',
    'username',
    'password!2018',
    'affiliate_bag_details String',
    'connectTimeoutMS=10000'
) 
LIMIT 10;

Getting the following error Exception: Type mismatch, expected String, got type id = 3 for column affiliate_bag_details: While executing MongoDB. Can anyone please suggest what is an alternative schema that i can use to perform the above operation?

HitendraSinghRathore avatar May 19 '24 04:05 HitendraSinghRathore