Standard URI Format
Parent: MongoDB Connection String URI · Published reference · snapshot 2026-10-23 · skill mongodb-cohort-6f6a12e41dfc
↓ Facts as markdownall context files
Source-anchored research for Standard URI Format. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Structure and components
- The standard MongoDB connection string has the form `mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]`: credentials are optional, the host list can contain multiple `host[:port]` entries, and the database path and query options are optional. (high confidence) [source]
How it works
- When a port is omitted from a standard MongoDB URI, the default port is `27017`. (high confidence) [source]
Problems, failure modes and limitations
- The MongoDB driver specification describes connection strings as URI-style but says their grammar does not conform to RFC 3986 and cannot be parsed by generic URI parsers; applications need a parser that understands MongoDB connection strings. (medium confidence) [source]
Facts and statements
- The SRV form is `mongodb+srv://[username:password@]host[/[defaultauthdb][?options]]`; it accepts one hostname without an explicit port, then the driver queries DNS SRV records to discover the hosts. (high confidence) [source]
- Connection options use `?name=value` query parameters; if options appear without a database path, include `/` between the last host and `?`. (low confidence) [source]
- For portable credentials, percent-encode `$ : / ? # [ ] @` in MongoDB usernames and passwords. RFC 3986 defines a percent-encoded octet as `%` followed by two hexadecimal digits; the MongoDB connection-string specification says drivers should follow RFC 3986 userinfo rules but may accept some reserved characters unencoded for backward compatibility. (high confidence) [source]
- MongoDB's current documentation differs on replica-set seed completeness: the Manual says standard connection strings require all cluster members, while the SDAM specification and current .NET/C# guide describe discovery from a seed list containing one or more members. (medium confidence) (verified as of 2026-10-23) [source]
Children
- No children recorded.