Replica set failover
- Last Updated: July 30, 2025
- 1 minute read
- DataDirect Connectors
- ODBC
- MongoDB 8.0
- Documentation
Note: The strings
demonstrated in this section use the DSN-less format. For additional formats, see "Using a
connection string."
This string includes the options used to connect through a proxy server with authentication.
DRIVER=DataDirect 8.1 MongoDB;AuthenticationMethod=15;DatabaseName=database;
HostName=hostname;PortNumber=port;ReplicaSetName=replica_set;
[attribute=value[;...]];
where:
- database
-
(optional) specifies the name of the database to which you want to connect. This value is used as the default qualifier for unqualified table names in SQL queries.Note: This value is case-insensitive if you have access privileges to query the list of databases on the server. If you do not have access, this value is case-sensitive.
- hostname
- the name or the IP address of the server to which you want to connect. For example, myserver.
- port
-
specifies the port number of the server listener. The default is
27017.
- replica_set
- specifies the name of the replica set against which you want to execute write operations.
- attribute=value
- specifies connection option settings. Multiple option attributes are separated by a semi-colon.
The following example connection string includes the options used to enable replica set failover for write operations with no authentication:
DRIVER=DataDirect 8.1 MongoDB;AuthenticationMethod=15;DatabaseName=mydb;
HostName=myserver;PortNumber=27017;ReplicaSetName=MyReplicaSet;