25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
fix(mongodb): set directConnection=true for single-host to bypass replica set discovery
t8y229e7267d3122
diff --git a/crates/dbx-core/src/db/mongo_driver.rs b/crates/dbx-core/src/db/mongo_driver.rsindex a1b8fed386..0c7e74e16f 100644--- a/crates/dbx-core/src/db/mongo_driver.rs+++ b/crates/dbx-core/src/db/mongo_driver.rs@@ -31,6 +31,13 @@ pub async fn connect(url: &str, timeout: Duration, idle_timeout: Duration) -> Reif idle_timeout.as_secs() > 0 {options.max_idle_time = Some(idle_timeout);}+ // For single-host connections, force direct connection to avoid replica+ // set discovery. This is essential when connecting through a TCP proxy+ // or NAT where the driver would otherwise receive internal IPs from+ // the replica set handshake and fail to connect.+ if !is_multi_host {+ options.direct_connection = Some(true);+ }Client::with_options(options).map_err(|e| format!("MongoDB connection failed: {e}"))}).await