Docs Menu
Docs Home
/
MongoDB Compass
/ /

General Connection Tab

On this page

  • Procedure
  • Example

The General connection tab allows you to select a Connection String Scheme and configure the hostname or hosts used to connect to your MongoDB deployment.

Note

Starting in version 1.44.0, you can connect to multiple MongoDB instances at once through Compass.

1

In the bottom panel of the Connections Sidebar, click Add New Connection to open the New Connection modal.

If you already have connections listed in the Connections Sidebar, click the icon on the top right of the sidebar to open the New Connection modal.

2
New Advanced Connection Options
click to enlarge
3
  1. Select a connection string scheme.

    You can select one of the following options:

    Connection String Scheme
    Definition

    mongodb

    Standard Connection String Format. The standard format of the MongoDB connection URI is used to connect to a MongoDB deployment by specifying its hosts directly.

    Use this option to connect to standalone, replica set, or a sharded cluster

    Note

    If you use the standard connection string format to connect to an Atlas deployment, you must turn on TLS/SSL in the TLS/SSL tab of the New Connection modal.

    mongodb+srv

    DNS Seed List Connection Format. The +srv indicates to MongoDB Compass that the hostname that follows corresponds to a DNS SRV record.

    Note

    The +srv automatically enables TLS/SSL.

  2. Enter a Hostname.

    In the Host field, enter the hosts or hostname of the server where the deployment is running.

    If you are running your deployment locally, this value is localhost. If you are connecting to an Atlas cluster, see Connect to Database Deployment for Atlas-specific guidance on how to connect with Compass.

    If you are not sure of your hostname, contact your Database Administrator for information.

  3. (Optional) Enable Direct Connection.

    When you use the mongodb Connection String Scheme, you have the option to enable a Direct Connection. When you enable this setting, Compass runs all operations on the specified host.

    Important

    When you specify directConnection and connect to a secondary member of a replica set, your write operations fail because it is not the primary member.

4
5

Tip

See also:

To disconnect from your deployment, see Disconnect from MongoDB.

The following example specifies a connection with SCRAM-SHA-256 in the General tab. Since the connection uses the mongodb connection string scheme to connect to an Atlas cluster, the connection also enables TLS/SSL.

Screenshot of Compass configured to connect to an example Atlas cluster
click to enlarge

Back

Advanced Options

On this page