Skip to content

Commit ed73bd2

Browse files
authored
DOCSP-48715-username-pw (#238) (#240)
* username pw * small change (cherry picked from commit 3878890)
1 parent 51e4a71 commit ed73bd2

9 files changed

+13
-13
lines changed

examples/src/test/kotlin/MongoClientSettingsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import kotlin.test.Ignore
2222
// }
2323

2424
/* NOTE: These tests are not run by default because they require a MongoDB deployment
25-
with a username and password. To run these tests locally, you need to set up your .env
25+
with a database username and database password. To run these tests locally, you need to set up your .env
2626
and replace the @Ignore annotation with @Test on the tests you want to run.
2727
*/
2828
class MongoClientSettingsTest {

examples/src/test/kotlin/NetworkCompressionTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import kotlin.test.assertEquals
1616
// :replace-start: {
1717
// "terms": {
1818
// "CONNECTION_URI_PLACEHOLDER": "\"<connection string>\"",
19-
// "${uri}&": "mongodb+srv://<user>:<password>@<cluster-url>/?"
19+
// "${uri}&": "mongodb+srv://<db_username>:<db_password>@<cluster-url>/?"
2020
// }
2121
// }
2222

examples/src/test/kotlin/SocksTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import kotlin.test.Ignore
1414
// :replace-start: {
1515
// "terms": {
1616
// "CONNECTION_URI_PLACEHOLDER": "\"<connection string>\"",
17-
// "${uri}&": "mongodb+srv://<user>:<password>@<cluster-url>/?"
17+
// "${uri}&": "mongodb+srv://<db_username>:<db_password>@<cluster-url>/?"
1818
// }
1919
// }
2020

examples/src/test/kotlin/TlsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal class TlsTest {
3232
@Disabled("Disabled because host does not exist")
3333
fun tlsConnectionStringTest() = runBlocking {
3434
// :snippet-start: tls-connection-string
35-
val mongoClient = MongoClient.create("mongodb+srv://<user>:<password>@<cluster-url>?tls=true")
35+
val mongoClient = MongoClient.create("mongodb+srv://<db_username>:<db_password>@<cluster-url>?tls=true")
3636
// :snippet-end:
3737
mongoClient.close()
3838
}

source/connection-troubleshooting.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ issues when attempting to connect to MongoDB.
9292
For more information about using connection strings with the {+driver-short+},
9393
see :ref:`Connection URI <connection-uri>` in the Connection Guide.
9494

95-
If your connection string contains a username and password, ensure that they
95+
If your connection string contains a database username and database password, ensure that they
9696
are in the correct format.
9797

9898
.. note::
9999

100-
If the username or password includes any of the following characters, they
100+
If the database username or database password includes any of the following characters, they
101101
must be `percent encoded <https://tools.ietf.org/html/rfc3986#section-2.1>`__:
102102

103103
.. code-block:: none
@@ -119,8 +119,8 @@ connection if one of the hosts is unreachable.
119119
Verify User Is in Authentication Database
120120
-----------------------------------------
121121

122-
To successfully authenticate a connection by using a username and password,
123-
the username must be defined in the authentication database. The default
122+
To successfully authenticate a connection by using a database username and database password,
123+
the database username must be defined in the authentication database. The default
124124
authentication database is the ``admin`` database. To use a different database
125125
for authentication, specify the ``authSource`` in the connection string. The
126126
following example instructs the driver to use ``users`` as the authentication
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Replace the placeholders with values from your MongoDB deployment's connection string
2-
val connectionString = ConnectionString("mongodb+srv://<user>:<password>@<cluster-url>/?compressors=snappy,zlib,zstd")
2+
val connectionString = ConnectionString("mongodb+srv://<db_username>:<db_password>@<cluster-url>/?compressors=snappy,zlib,zstd")
33

44
// Create a new client with your settings
5-
val mongoClient = MongoClient.create(connectionString)
5+
val mongoClient = MongoClient.create(connectionString)

source/examples/generated/SocksTest.snippet.socks-connection-string.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
val connectionString = ConnectionString(
2-
"mongodb+srv://<user>:<password>@<cluster-url>/?" +
2+
"mongodb+srv://<db_username>:<db_password>@<cluster-url>/?" +
33
"proxyHost=<proxyHost>" +
44
"&proxyPort=<proxyPort>" +
55
"&proxyUsername=<proxyUsername>" +
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
val mongoClient = MongoClient.create("mongodb+srv://<user>:<password>@<cluster-url>?tls=true")
1+
val mongoClient = MongoClient.create("mongodb+srv://<db_username>:<db_password>@<cluster-url>?tls=true")

source/usage-examples.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ to learn how to allow connections to your instance of Atlas and to find the
6666
:manual:`connection string </reference/connection-string/>` you use to replace the
6767
``uri`` variable in usage examples. If your instance uses
6868
:manual:`SCRAM authentication </core/security-scram/>`, you can replace
69-
``<user>`` with your username, ``<password>`` with your password, and
69+
``<db_username>`` with your database username, ``<db_password>`` with your database password, and
7070
``<cluster-url>`` with the IP address or URL of your instance.
7171

7272
For more information about connecting to your MongoDB instance, see our

0 commit comments

Comments
 (0)