Skip to content

Commit

Permalink
update username and password placeholders (#899)
Browse files Browse the repository at this point in the history
(cherry picked from commit e955361)
  • Loading branch information
jordan-smith721 committed Aug 14, 2024
1 parent cd19117 commit 8d95ace
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions source/code-snippets/authentication/cr.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { MongoClient } = require("mongodb");

// Replace the following with values for your environment.
const username = encodeURIComponent("<username>");
const password = encodeURIComponent("<password>");
const username = encodeURIComponent("<db_username>");
const password = encodeURIComponent("<db_password>");
const clusterUrl = "<MongoDB cluster url>";

// Replace the following with your MongoDB deployment's connection string.
Expand Down
4 changes: 2 additions & 2 deletions source/code-snippets/authentication/default.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { MongoClient } = require("mongodb");

// Replace the following with values for your environment.
const username = encodeURIComponent("<username>");
const password = encodeURIComponent("<password>");
const username = encodeURIComponent("<db_username>");
const password = encodeURIComponent("<db_password>");
const clusterUrl = "<MongoDB cluster url>";

const authMechanism = "DEFAULT";
Expand Down
4 changes: 2 additions & 2 deletions source/code-snippets/authentication/sha1.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { MongoClient } = require("mongodb");

// Replace the following with values for your environment.
const username = encodeURIComponent("<username>");
const password = encodeURIComponent("<password>");
const username = encodeURIComponent("<db_username>");
const password = encodeURIComponent("<db_password>");
const clusterUrl = "<MongoDB cluster url>";

const authMechanism = "SCRAM-SHA-1";
Expand Down
4 changes: 2 additions & 2 deletions source/code-snippets/authentication/sha256.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { MongoClient } = require("mongodb");

// Replace the following with values for your environment.
const username = encodeURIComponent("<username>");
const password = encodeURIComponent("<password>");
const username = encodeURIComponent("<db_username>");
const password = encodeURIComponent("<db_password>");
const clusterUrl = "<MongoDB cluster url>";

const authMechanism = "SCRAM-SHA-256";
Expand Down
2 changes: 1 addition & 1 deletion source/connection-troubleshooting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ database:
:copyable: true

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

You can check if this is the issue by attempting to connect to a MongoDB
Expand Down
4 changes: 2 additions & 2 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -999,9 +999,9 @@ Authentication

.. code-block:: js

new MongoClient("mongodb://username:password@<host><port>")
new MongoClient("mongodb://<db_username>:<db_password>@<host><port>")
// or
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
new MongoClient(url, { auth: { username: "<db_username>", password: "<db_password>" } })

``GridStore`` Removal
`````````````````````
Expand Down

0 comments on commit 8d95ace

Please sign in to comment.