Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/

Connection Strings

You can use connection strings to define connections between MongoDB instances and the following destinations:

  • Your applications when you connect using drivers.

  • Tools such as MongoDB Compass and MongoDB Shell (mongosh).

To connect to your cluster, you can use one of these connection string formats:

  • SRV connection strings use the mongodb+srv:// prefix to simplify connecting to a cluster. SRV connection strings automatically include all seed list hosts, which supports server rotation without client reconfiguration. When possible, use SRV connection strings over standard connection strings.

  • Standard connection strings use the mongodb:// prefix and require you to include all cluster members in replica sets and sharded clusters.

Use the selectors at the top of the page to choose your deployment type and connection string format. Complete the following steps to find your connection string.

For a full list of connection string options, see Connection String Options.

Back

Clustered Collections

On this page