MotionQL

MongoDB connection string builder

Build or parse mongodb:// and mongodb+srv:// URIs. Split a pasted URI into hosts, credentials and options, catch common mistakes, and copy a correctly encoded string with the password masked.

Runs entirely in your browser. Nothing you paste is sent to any server.

Builder

SRV host name
Other options

Connection string

mongodb+srv://appUser:****@cluster0.example.mongodb.net/shop?retryWrites=true&w=majority&appName=Cluster0

The password is masked on screen. Copy the real string only when you need it.

Checks

Good: No problems found

Parsed

Scheme
mongodb+srv://
Host
cluster0.example.mongodb.net
Username
appUser
Password
••••••
Database
shop
  • retryWrites=true

    Retry certain writes once after a network error. On by default in modern drivers.

  • w=majority

    Write concern: a number of nodes, majority, or a tag set name.

  • appName=Cluster0

    Name shown in server logs, currentOp and profiler output.

Do this against your real data with MotionQL

Paste this connection string into MotionQL to connect: SRV, replica sets, sharded clusters, SSH jump hosts, X.509, LDAP, Kerberos, AWS IAM and OIDC are supported, and secrets stay encrypted with your OS keychain. Pro is free for a year.

Anatomy of a MongoDB connection string

mongodb://user:password@host1:27017,host2:27017/defaultdb?replicaSet=rs0&authSource=admin

  • Scheme: mongodb:// for an explicit host list, or mongodb+srv:// for a DNS seed list.
  • Credentials: optional user:password@, percent-encoded.
  • Hosts: one or more host:port pairs separated by commas. IPv6 addresses go in brackets.
  • Default database: the path after the first /; also the default authentication database.
  • Options: key=value pairs after ?, joined with &. Option names are case-insensitive.

The checker flags what drivers reject or what commonly breaks a connection: ports on SRV hosts, unescaped characters in passwords, directConnection with several hosts, invalid option values and conflicting TLS settings. It does not resolve DNS or connect to your server.

FAQ

Questions, answered

mongodb:// lists every host and port yourself. mongodb+srv:// gives one DNS name; the driver looks up its SRV record to find the hosts and its TXT record for options such as replicaSet and authSource. The +srv form also turns TLS on by default and cannot include a port.

More free MongoDB tools