File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
source/fundamentals/authentication Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,12 @@ Code Placeholders
3838
3939The code examples on this page use the following placeholders:
4040
41- - ``+srv``: Include this option in your connection string prefix only if you are connecting
42- to a MongoDB Atlas cluster. To learn more about the ``+srv`` option, see
43- :manual:`Connection String Formats </reference/connection-string/#connection-string-formats>`
44- in the {+mdb-server+} manual.
41+ - ``+srv``: Include this option in your connection string prefix only if you are
42+ connecting to a MongoDB Atlas cluster. If you're using a
43+ ``MongoClientSettings`` object, you can specify the ``srv`` format by setting
44+ the ``Scheme`` property to ``ConnectionStringScheme.MongoDBPlusSrv``. To learn
45+ more about the ``+srv`` option, see :manual:`Connection String Formats </reference/connection-string/#connection-string-formats>` in the
46+ {+mdb-server+} manual.
4547- ``<hostname>``: The network address of your MongoDB deployment.
4648- ``<port>``: The port number of the MongoDB deployment. If you omit this parameter,
4749 the driver uses the default port number (``27017``). You don't need a port number
@@ -119,6 +121,7 @@ see the corresponding syntax:
119121 },
120122 UseTls = true,
121123 Server = new MongoServerAddress("<hostname>"[, "<port>"]),
124+ Scheme = ConnectionStringScheme.MongoDBPlusSrv, // Needed when connecting to MongoDB Atlas
122125 };
123126
124127Troubleshooting
You can’t perform that action at this time.
0 commit comments