Skip to content

Commit 809c77d

Browse files
update username and password placeholders (#899)
(cherry picked from commit e955361)
1 parent 96b75d3 commit 809c77d

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

source/code-snippets/authentication/cr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const { MongoClient } = require("mongodb");
22

33
// Replace the following with values for your environment.
4-
const username = encodeURIComponent("<username>");
5-
const password = encodeURIComponent("<password>");
4+
const username = encodeURIComponent("<db_username>");
5+
const password = encodeURIComponent("<db_password>");
66
const clusterUrl = "<MongoDB cluster url>";
77

88
// Replace the following with your MongoDB deployment's connection string.

source/code-snippets/authentication/default.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const { MongoClient } = require("mongodb");
22

33
// Replace the following with values for your environment.
4-
const username = encodeURIComponent("<username>");
5-
const password = encodeURIComponent("<password>");
4+
const username = encodeURIComponent("<db_username>");
5+
const password = encodeURIComponent("<db_password>");
66
const clusterUrl = "<MongoDB cluster url>";
77

88
const authMechanism = "DEFAULT";

source/code-snippets/authentication/sha1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const { MongoClient } = require("mongodb");
22

33
// Replace the following with values for your environment.
4-
const username = encodeURIComponent("<username>");
5-
const password = encodeURIComponent("<password>");
4+
const username = encodeURIComponent("<db_username>");
5+
const password = encodeURIComponent("<db_password>");
66
const clusterUrl = "<MongoDB cluster url>";
77

88
const authMechanism = "SCRAM-SHA-1";

source/code-snippets/authentication/sha256.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const { MongoClient } = require("mongodb");
22

33
// Replace the following with values for your environment.
4-
const username = encodeURIComponent("<username>");
5-
const password = encodeURIComponent("<password>");
4+
const username = encodeURIComponent("<db_username>");
5+
const password = encodeURIComponent("<db_password>");
66
const clusterUrl = "<MongoDB cluster url>";
77

88
const authMechanism = "SCRAM-SHA-256";

source/connection-troubleshooting.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ database:
215215
:copyable: true
216216

217217
const { MongoClient } = require("mongodb");
218-
const uri = "mongodb://<username>:<password>@<hostname>:<port>/?authSource=users";
218+
const uri = "mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=users";
219219
const client = new MongoClient(uri);
220220

221221
You can check if this is the issue by attempting to connect to a MongoDB

source/whats-new.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,9 +1089,9 @@ Authentication
10891089

10901090
.. code-block:: js
10911091

1092-
new MongoClient("mongodb://username:password@<host><port>")
1092+
new MongoClient("mongodb://<db_username>:<db_password>@<host><port>")
10931093
// or
1094-
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
1094+
new MongoClient(url, { auth: { username: "<db_username>", password: "<db_password>" } })
10951095

10961096
``GridStore`` Removal
10971097
`````````````````````

0 commit comments

Comments
 (0)