v.23.3Improvement
External Tables in MongoDB: Replica Set URI Support and Read Preference Option
External tables from MongoDB: support for connection to a replica set via a URI with a host:port enum and support for the readPreference option in MongoDB dictionaries. Example URI: mongodb://db0.example.com:27017,db1.example.com:27017,db2.example.com:27017/?replicaSet=myRepl&readPreference=primary. #46524 (artem-yadr).Why it matters
This feature allows users to configure ClickHouse to connect to MongoDB replica sets more flexibly and reliably by specifying multiple hosts and the desired read preference. It improves resilience and read operation control when querying MongoDB data through ClickHouse external tables and dictionaries.How to use it
Specify a MongoDB URI with multiplehost:port entries separated by commas and include the replicaSet and readPreference options in the connection string. For example:mongodb://db0.example.com:27017,db1.example.com:27017,db2.example.com:27017/?replicaSet=myRepl&readPreference=primaryUse this URI when configuring MongoDB dictionaries or external tables in ClickHouse to connect to the replica set and control the read preference.