File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
source/fundamentals/authentication Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,8 @@ The code examples on this page use the following placeholders:
3939- ``<password>``: Your LDAP password.
4040- ``<hostname>``: The network address of your MongoDB deployment.
4141- ``<port>``: The port number of your MongoDB deployment. If you omit this parameter,
42- the driver uses the default port number (``27017``).
42+ the driver uses the default port number (``27017``). You don't need to specify a port
43+ when connecting to a MongoDB Atlas cluster.
4344- ``<authenticationDb>``: The MongoDB database that contains the user's LDAP credentials.
4445 If you omit this parameter, the driver uses the default database (``admin``).
4546
@@ -62,7 +63,7 @@ see the corresponding syntax:
6263 .. code-block:: csharp
6364
6465 var mongoClient = new MongoClient(
65- "mongodb://<username>:<password>@<hostname>/?authSource=<authenticationDb>" +
66+ "mongodb://<username>:<password>@<hostname>[:<port>] /?authSource=<authenticationDb>" +
6667 "&authMechanism=PLAIN");
6768
6869 .. tab:: MongoCredential
Original file line number Diff line number Diff line change @@ -47,8 +47,9 @@ The code examples on this page use the following placeholders:
4747
4848- ``<db_username>``: The MongoDB username of the user to authenticate.
4949- ``<db_password>``: The MongoDB password of the user to authenticate.
50- - ``<hostname>``: The network address of the MongoDB deployment.
51- - ``<port>``: The port number of the MongoDB deployment. You don't need a port number
50+ - ``<hostname>``: The network address of your MongoDB deployment.
51+ - ``<port>``: The port number of your MongoDB deployment. If you omit this parameter,
52+ the driver uses the default port number (``27017``). You don't need a port number
5253 when connecting to a MongoDB Atlas cluster.
5354- ``<authenticationDb>``: The MongoDB database that contains the user's authentication
5455 data. If you omit this parameter, the driver uses the default value, ``admin``.
Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ The code examples on this page use the following placeholders:
4040
4141- ``<hostname>``: The network address of your MongoDB deployment.
4242- ``<port>``: The port number of the MongoDB deployment. If you omit this parameter,
43- the driver uses the default port number (``27017``).
43+ the driver uses the default port number (``27017``). You don't need a port number
44+ when connecting to a MongoDB Atlas cluster.
4445- ``<X.509 certificate username>``: The username of the user associated with the X.509
4546 certificate. The username must match the distinguished subject name of the certificate.
4647 If you omit this parameter, the MongoDB deployment infers the username
You can’t perform that action at this time.
0 commit comments