ConnectionString (original) (raw)

Represents a Connection String. The Connection String describes the hosts to be used and options.

The format of the Connection String is:

mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database.collection][?options]]

An alternative format, using the mongodb+srv protocol, is:

mongodb+srv://[username:password@]host[/[database][?options]]

The following options are supported (case insensitive):

Server Selection Configuration:

Server Monitoring Configuration:

Replica set configuration:

Connection Configuration:

Connection pool configuration:

Write concern configuration:

Read preference configuration:

Authentication configuration:

Server Handshake configuration:

Compressor configuration:

General configuration: