Documentation

MongoDB Connection Manager

Connection Manager

The Connection Manager is your central hub for organizing and managing all MongoDB database connections. Create, edit, test, and organize connections into projects and environments for streamlined database access across your team.

Quick Start

Get connected to your MongoDB database in three simple steps:

  1. Open the Connection Manager from the Welcome screen or toolbar
  2. Click "New Connection" and enter your connection details (host, port, authentication)
  3. Click "Test Connection" to verify, then "Save & Connect" to start working
Connection Manager overview showing projects, environments, and connection list
Video CONN02 Creating Your First Connection - Step-by-step walkthrough of clicking "New Connection", filling out the Server tab with hostname and port, configuring authentication credentials, testing the connection to verify settings, and clicking "Save & Connect" to complete the setup.

Connection Organization

VisualLeaf offers flexible connection management through three organizational levels:

Organization Hierarchy

  • Projects - Top-level containers for grouping related connections (e.g., "E-Commerce App", "Analytics Platform")
  • Environments - Sub-groups within projects for deployment stages (e.g., Development, Staging, Production). Each environment has a color-coded label for quick visual identification
  • Connections - Individual database connection configurations within environments
  • Ungrouped - Standalone connections not assigned to any project

View Modes

Use the sidebar to filter your connection display:

  • All Connections - Shows both ungrouped connections and all projects
  • By Project - Shows only project-organized connections
  • Ungrouped - Shows only standalone connections
Sidebar showing project hierarchy with color-coded environments

Creating and Editing Connections

The connection form provides comprehensive configuration across five tabs: Server, Authentication, SSL, SSH, and Options.

Connection form with all five tabs visible

Quick Actions

  • Test Connection - Validates your connection settings without saving. Shows step-by-step progress including network connectivity, authentication, SSL/TLS handshake, and database access verification.
  • Create from URL - Import connection settings from a MongoDB connection string (mongodb:// or mongodb+srv://). Automatically populates all form fields across all tabs.
  • Export to URL - Generate a standard MongoDB connection string from your current form settings for sharing or use in other applications.

Connection String Auto-Fill

Paste a MongoDB connection string directly into the form to automatically populate all fields:

  • Standard format: mongodb://username:password@host:port/database
  • DNS Seedlist format: mongodb+srv://username:password@cluster.mongodb.net/database
  • Supports query parameters for SSL, authentication, and connection options

Database Type

At the top of the connection form, you'll find the Database Type selector. This determines which database platform you're connecting to.

Database Type Status Description
MongoDB Available Full support for MongoDB databases including Atlas, standalone, replica sets, and sharded clusters
Amazon DocumentDB 8.0+ Coming Soon Native connectivity to Amazon DocumentDB, including compatibility with MongoDB APIs, query execution, schema visualization, and data exploration - making it easy to manage DocumentDB clusters with the same VisuaLeaf experience you use for MongoDB.
Azure Cosmos DB 4.2+ Coming Soon Native support for Azure Cosmos DB (MongoDB API), enabling seamless connections, query execution, schema visualization, and data exploration within VisuaLeaf.
Redis 7.0+ Coming Soon Native connectivity to Redis databases, enabling key exploration, data type visualization, TTL management, and real-time monitoring within VisuaLeaf.

Note: Currently only MongoDB is fully supported. Additional database platforms will be added in future releases. The interface will adapt based on the selected database type to show relevant configuration options.

Server Tab

Configure the database server connection details and deployment topology.

Server tab showing connection type selector and configuration fields

Connection Types

Type Description When to Use
Standalone Single MongoDB server instance Development, testing, or small deployments without high availability requirements
Replica Set Group of MongoDB servers maintaining the same data for redundancy Production deployments requiring high availability, automatic failover, and read scaling
Sharded Cluster Horizontally partitioned database across multiple shards Large-scale deployments with massive datasets that exceed single-server capacity
DNS Seedlist Dynamic server discovery using DNS SRV records (mongodb+srv://) MongoDB Atlas or cloud deployments with dynamic IP addresses

Standalone Configuration

Field Description Default
Host Server hostname or IP address localhost
Port MongoDB server port number 27017
Database Name Default database to connect to (optional) None
Read Preference How to route read operations (Primary, Secondary, Nearest) Nearest

Replica Set Configuration

Field Description Required
Replica Set Name Name of the replica set (must match server configuration) Yes
Replica Hosts List of host:port pairs for replica set members Yes (at least one)
Read From Hidden Nodes Allow reads from hidden replica set members No
Resolve Cluster Members Automatically discover all replica set members No

Sharded Cluster Configuration

Field Description Required
Mongos Hosts List of host:port pairs for mongos routers Yes (at least one)
Read Preference Routing preference for read operations across shards No

DNS Seedlist Configuration

Field Description Default
Connection URI DNS hostname for SRV record lookup (e.g., cluster.mongodb.net) None
SRV Service Name Custom SRV service name (optional) mongodb

Authentication Tab

Configure how VisualLeaf authenticates with your MongoDB server. Multiple authentication mechanisms are supported.

Authentication tab showing SCRAM-SHA-256 configuration

Authentication Mechanisms

Mechanism Description Use Case
None No authentication required Local development servers without security
SCRAM-SHA-256 Salted Challenge Response Authentication (recommended) Default for MongoDB 4.0+ deployments
SCRAM-SHA-1 Legacy SCRAM authentication MongoDB 3.x or servers configured for SHA-1
X.509 Certificate-based authentication High-security environments requiring mutual TLS
Kerberos (GSSAPI) Kerberos authentication (Available Q2 2026) Enterprise deployments with Active Directory
LDAP (PLAIN) LDAP directory authentication MongoDB Enterprise with LDAP integration
AWS IAM AWS Identity and Access Management MongoDB Atlas on AWS with IAM roles
OIDC OpenID Connect (Available Q2 2026) Modern SSO integrations

SCRAM-SHA-256 / SCRAM-SHA-1 Configuration

Field Description Required
Username MongoDB username Yes
Password MongoDB password (click eye icon to show/hide) Yes
Auth Database Database containing user credentials. Defaults to 'admin' No

X.509 Configuration

X.509 authentication uses client certificates instead of username/password. No additional fields are required beyond SSL configuration.

  • Authentication database is always $external
  • Username is extracted from the client certificate's Subject DN
  • Requires SSL tab configuration with client certificate

AWS IAM Configuration

Field Description Required
Access Key ID AWS IAM access key (e.g., AKIAIOSFODNN7EXAMPLE) Yes
Secret Access Key AWS IAM secret key (click eye icon to show/hide) Yes
Session Token Temporary session token for STS AssumeRole credentials No (only for temporary credentials)

LDAP (PLAIN) Configuration

Field Description Required
LDAP Username LDAP directory username (e.g., user@domain.com or CN=user,DC=domain,DC=com) Yes
Password LDAP password Yes

SSL/TLS Tab

Configure SSL/TLS encryption for secure communication with MongoDB. Essential for production deployments and cloud services like MongoDB Atlas.

SSL tab showing certificate configuration options

SSL Mode

Toggle SSL/TLS encryption on or off using the switch at the top of the tab.

Certificate Configuration

Option Description When to Use
Use own Root CA file Validate server certificate against a specific CA certificate file Self-signed certificates or internal CAs
Accept OS-trusted certificates Trust certificates signed by system-trusted CAs MongoDB Atlas or certificates from public CAs
Accept any certificates Skip certificate validation (insecure) Development/testing only - NOT for production

CA Certificate (Root CA File)

Field Description Format
CA Certificate Path to Certificate Authority file (--sslCAFile). Click Browse to select file. PEM format (.pem, .crt)

Client Certificate (Mutual TLS)

Enable the "Use Client Certificate" toggle to configure client-side authentication for mutual TLS:

Field Description Format
Client Certificate Client certificate file path. Click Browse to select file. PEM format (.pem, .crt)
Private Key Private key file path (if separate from certificate). Click Browse to select file. PEM format (.pem, .key)
Has Passphrase Toggle if private key is encrypted with a passphrase Checkbox
Passphrase Passphrase to decrypt the private key (if encrypted) Text (hidden)

SSH Tunnel Tab

Configure SSH tunneling to connect to MongoDB servers behind firewalls or in private networks. The SSH tunnel creates a secure connection through an intermediate server.

Video CONN08 Configuring SSH Tunnels - Complete demonstration of enabling SSH tunneling, entering the bastion server details, choosing between password and private key authentication, testing the SSH connection, and successfully connecting to a MongoDB server through the secure tunnel.
SSH tunnel configuration with password authentication

SSH Tunnel Mode

Toggle SSH tunneling on or off using the switch at the top of the tab.

SSH Connection Settings

Field Description Default
SSH Host Hostname or IP address of the SSH server (bastion host) None
SSH Port SSH server port number 22
SSH Username SSH login username None

SSH Authentication Modes

Mode Required Fields Description
Password SSH Password (hidden input with show/hide toggle) Simple password authentication for SSH connection
Private Key Private Key File Path, Has Passphrase (checkbox), Passphrase (optional) Public key authentication using SSH key pair. More secure than password. Enable "Has passphrase" if key is encrypted.

How SSH Tunneling Works

  1. VisualLeaf connects to the SSH server using your credentials
  2. A secure tunnel is established through the SSH connection
  3. MongoDB traffic is forwarded through the tunnel to the database server
  4. This allows connecting to databases in private networks without exposing them publicly

Options Tab

Configure advanced connection behavior including timeouts, connection pooling, retry logic, and write concerns. These settings directly affect performance and reliability.

Options tab showing timeout and connection pool settings

Timeout Settings

Field Description Default
Socket Timeout Maximum time to wait for data during read operations. Increase for long-running queries and aggregations. 300 seconds
Connect Timeout Maximum time to wait when establishing a new connection. Increase for slow networks. 30 seconds
Server Selection Maximum time to wait for selecting appropriate server (replica set/sharded cluster). 30 seconds

Connection Pool Settings

Field Description Default
Max Pool Size Maximum connections in the pool. Higher values allow more concurrent operations but use more memory. 100
Min Pool Size Minimum connections to maintain. Keeps connections ready for faster response. Must be ≤ Max Pool Size. 0
Max Idle Time Maximum time a connection can remain idle before being closed. Helps release unused connections. 10 minutes

Behavior Settings

Field Description Default
Retry Writes Automatically retry write operations that fail due to network errors or replica set elections. Recommended for production. Enabled
Retry Reads Automatically retry read operations that fail due to network errors. Improves reliability for read-heavy workloads. Enabled
Compress (zlib) Compress data between client and server using zlib. Reduces network bandwidth but adds CPU overhead. Useful for slow networks. Enabled
Load Balanced Enable load balanced mode for MongoDB Atlas or other load balancer deployments. Only enable if connecting through a load balancer. Disabled
App Name Identifier sent to MongoDB server. Appears in logs, db.currentOp(), and profiler output. Useful for debugging and monitoring. VisuaLeaf

Write Concern Settings

Field Description Default
W (Acknowledgment) majority: Wait for majority of replica set members (recommended)
1: Wait for primary only (faster, less safe)
0: No acknowledgment (fire-and-forget, not recommended)
majority
Timeout (ms) Maximum time to wait for write concern acknowledgment. If exceeded, write returns error even if it succeeded. No timeout
Journal Wait for write to be committed to on-disk journal before acknowledging. Provides durability guarantee but adds latency. Server Default

Reset to Defaults

Click the "Reset to Defaults" button at the top of the Options tab to restore all settings to their recommended values.

Testing Connections

The Test Connection feature validates your configuration before saving. It performs comprehensive checks across all connection aspects.

Video CONN11 Testing and Troubleshooting Connections - Watch the complete connection test workflow including network connectivity checks, SSL/TLS handshake validation, authentication verification, and database access confirmation. Learn how to interpret error messages and fix common connection issues.
Test Connection modal showing step-by-step validation progress

Test Connection Steps

  1. Network Connectivity - Verifies the server is reachable at the specified host and port
  2. SSH Tunnel - Establishes SSH tunnel if configured
  3. SSL/TLS Handshake - Validates SSL certificates and establishes encrypted connection
  4. Authentication - Verifies credentials using the selected authentication mechanism
  5. Database Access - Confirms ability to list databases and collections
  6. Permissions Check - Validates user has necessary privileges

Each step shows a status indicator (pending, in progress, success, or error). If any step fails, detailed error messages help diagnose the issue.

Connection Actions

Main Actions

  • New Connection - Create a new database connection. Opens the connection form with default values.
  • New Project - Create a new project container. Projects include a default environment which can be renamed and color-coded.
  • Import - Import connections from a JSON file. Supports both individual connections and bulk imports.
  • Export - Export all connections or selected connections to a JSON file for backup or sharing.
  • Select All / Select None - Toggle selection of all connections for bulk operations like export or delete.

Connection Card Actions

Each connection card provides quick actions:

  • Connect - Establish connection to the database
  • Edit - Modify connection settings
  • Clone - Duplicate connection with a new name
  • Delete - Remove connection (with confirmation)
  • Favorite - Mark as favorite for quick access

Drag and Drop Organization

Organize connections intuitively with drag and drop:

  • Drag connections to different projects or environments
  • Drag to "Ungrouped" to remove from projects
  • Reorder projects by dragging the project headers
  • Reorder environments within a project

Context Menus

Right-click on different elements to access context-specific actions:

Connection Context Menu

  • Edit - Open connection form
  • Clone - Duplicate connection
  • Delete - Remove connection
  • Test Connection - Validate settings

Project Context Menu

  • New Connection - Create connection in first environment
  • Add Environment - Create new environment in project
  • Rename - Change project name
  • Delete - Remove project (connections move to Ungrouped)

Environment Context Menu

  • New Connection - Create connection in this environment
  • Rename - Change environment name
  • Delete - Remove environment (connections move to Ungrouped)

Ungrouped Context Menu

  • New Connection - Create ungrouped connection

Search and Navigation

Search Functionality

Use the search bar in the header to quickly find connections:

  • Type connection name to filter the list
  • Press Enter or Arrow Down to jump to next match
  • Press Arrow Up to jump to previous match
  • Matched connection is highlighted and scrolled into view
  • Search works across all view modes (All, Projects, Ungrouped)

The sidebar allows quick filtering of connections:

  • All Connections - Shows everything
  • By Project - Shows only project-organized connections
  • Ungrouped - Shows only standalone connections

Click the chevron icon or the collapsed sidebar edge to toggle sidebar visibility. On mobile devices, the sidebar automatically collapses and appears as an overlay when opened.

Pro Tips

  1. Color-code environments - Click the server icon next to environment names to assign colors (red for production, green for development, etc.). This visual distinction helps prevent accidentally working on the wrong environment.
  2. Use connection string import - When setting up a new connection, paste your MongoDB connection string into the auto-fill field instead of manually entering each field. This is especially useful for MongoDB Atlas connections.
  3. Test before saving - Always click "Test Connection" before saving to catch configuration errors early. Pay attention to the step-by-step progress to identify exactly where issues occur.
  4. Organize with projects - Group related connections into projects (e.g., "E-Commerce App") with environments (Dev, Staging, Prod). This makes team collaboration and deployment workflows much clearer.
  5. Export for backup - Regularly export your connections to a JSON file as backup. This also allows you to share connection configurations (without passwords) with team members.
  6. Adjust timeouts for slow queries - If you run long aggregations or bulk operations, increase the Socket Timeout in the Options tab (e.g., 600 seconds) to prevent premature disconnections.
  7. Use Read Preference wisely - For replica sets, use "Nearest" for best latency, "Secondary" to offload reads from primary, or "Primary" when you need the absolute latest data.
  8. SSH tunneling for security - When connecting to databases in private networks or behind firewalls, use SSH tunneling instead of exposing MongoDB ports publicly. This adds an extra layer of security.
  9. Double-click to rename - Double-click on project or environment names in the sidebar to quickly rename them inline without opening a context menu.
  10. Save & Connect for speed - When creating a new connection, use the "Save & Connect" button to save your configuration and immediately connect in one action, skipping the connection manager reopening step.
  • Workspace Manager - Save and restore the UI state (open tabs, split views, expanded nodes) for different connection contexts
  • Sidebar - After connecting, explore databases, collections, views, and GridFS buckets in the left sidebar tree
  • Collection Activity - Once connected, view and edit documents in your collections
  • VisuaLeaf Config - Configure application-wide preferences that affect all connections

Ready to try VisuaLeaf?

Download and start managing your MongoDB databases with ease.

Download Free Trial