<@U04SE163WC8> I was trying create a connection b/...
# ask-ai
v
@kapa.ai I was trying create a connection b/w mongodb as source and clickouse as destination, but facing this error.
Discovering schema failed
Command failed with error 40394 (Location40394): 'PlanExecutor error during aggregation :: caused by :: $arrayToObject requires an object with keys 'k' and 'v', where the value of 'k' must be of type string. Found type: null' on server 13.200.176.192:27017. The full response is {"ok": 0.0, "errmsg": "PlanExecutor error during aggregation :: caused by :: $arrayToObject requires an object with keys 'k' and 'v', where the value of 'k' must be of type string. Found type: null", "code": 40394, "codeName": "Location40394", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1717146386, "i": 2}}, "signature": {"hash": {"$binary": {"base64": "MvnwbLn2r2zItPasrG/g8whem9M=", "subType": "00"}}, "keyId": 7332066643847151618}}, "operationTime": {"$timestamp": {"t": 1717146386, "i": 2}}}
k
It looks like you're encountering an error while trying to create a connection between MongoDB as the source and ClickHouse as the destination. The error message indicates that there is an issue with the
$arrayToObject
aggregation stage in MongoDB, specifically that it requires an object with keys 'k' and 'v', and the value of 'k' must be of type string. Here are some steps you can take to troubleshoot and resolve this issue: 1. Check MongoDB Data: Ensure that the data in your MongoDB collection adheres to the requirements of the
$arrayToObject
stage. Specifically, make sure that the objects being transformed have keys 'k' and 'v', and that the value of 'k' is always a string. 2. Review MongoDB Aggregation Pipeline: If you are using a custom aggregation pipeline, review it to ensure that it correctly formats the data before applying the
$arrayToObject
stage. 3. Connector Limitations and Troubleshooting: Refer to the MongoDB connector limitations and troubleshooting guide for more detailed information on common issues and their resolutions. You can find this guide [here](https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting). 4. Schema Discovery Issues: The error might also be related to schema discovery issues. There have been similar issues reported where schema discovery fails due to various reasons. For example, a known issue is the memory limit exceeded during schema discovery. You can refer to the closed GitHub issue [here](https://github.com/airbytehq/airbyte/issues/31338) for more context. 5. Schemaless Mode: If schema discovery continues to be problematic, consider using schemaless mode, which does not sample documents to create a list of fields. This might help bypass the issue. More information on implementing schemaless mode can be found in this [GitHub issue](https://github.com/airbytehq/airbyte/issues/32160). If these steps do not resolve the issue, you may want to provide more details or consult the Airbyte community for further assistance. You can also check out common troubleshooting issues on the [Airbyte Forum](https://github.com/airbytehq/airbyte/discussions). If you need further assistance, feel free to ask!