Connect to MongoDB
Understand MongoDB connection strings, SRV records, TLS, authentication and version-aware client behavior.
MongoDB connections are described by a connection string. A standard string can identify hosts, a port, credentials, an authentication source and options such as replica-set discovery. An SRV string delegates host discovery to DNS and is commonly used by managed MongoDB deployments.
Tablyne keeps the target recognizable. Record the connection name, cluster or host, database and environment separately from the secret. Credentials are supplied through the operating system’s protected storage rather than copied into a project file or displayed in logs.
TLS deserves an explicit decision. A connection may require encryption, validate the certificate authority, validate the server name, or use a deployment-specific certificate bundle. Tablyne makes the selected validation behavior clear because an encrypted connection without identity verification is a different security choice. A new connection to a host outside this computer, an SRV string, or a pasted string with tls=true selects verification; only an explicit tlsAllowInvalidCertificates/tlsInsecure selects encryption without verification. With no CA pasted, verification uses the system roots (the operating system’s certificate store; the public Mozilla roots only when that store is empty or unreadable; plus the CA from Settings › Network); a pasted CA replaces them. Through a single-host SSH tunnel the driver only sees the tunnel’s 127.0.0.1, so a new connection there encrypts without verification; the replica-set (SOCKS) tunnel verifies. An imported connection from another client keeps the TLS mode its connection string declares.
Authentication can depend on the deployment. SCRAM credentials, X.509 certificates, cloud identity and other mechanisms may use different connection-string options. Tablyne preserves unknown options instead of silently replacing them with defaults.
MongoDB version and server topology also matter. Feature availability can differ between server versions, standalone deployments, replica sets and sharded clusters. Tablyne tests the connection before saving it and keeps the resulting server information available for troubleshooting.
Tablyne keeps the connection string, TLS choice, authentication and server topology visible in the connection context.