Skip to content

Commit 18315f6

Browse files
(DOCSP-8860: Remove credentials from code snippet files (#64)
1 parent 5073340 commit 18315f6

File tree

5 files changed

+15
-40
lines changed

5 files changed

+15
-40
lines changed

source/code-snippets/crud/arrayFilters.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22
const { MongoClient } = require("mongodb");
33
const stream = require("stream");
44

5-
// Replace the following with your MongoDB deployment's connection
6-
// string.
5+
// Replace the following string with your MongoDB deployment's connection string.
76
const uri =
8-
"mongodb+srv://***REMOVED***/test?retryWrites=true&w=majority";
9-
10-
const client = new MongoClient(uri, {
11-
useNewUrlParser: true,
12-
useUnifiedTopology: true,
13-
});
7+
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
8+
const client = new MongoClient(uri);
149

1510
async function run() {
1611
try {

source/code-snippets/crud/cursor.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22
const { MongoClient } = require("mongodb");
33
const stream = require("stream");
44

5-
// Replace the following with your MongoDB deployment's connection
6-
// string.
5+
// Replace the following string with your MongoDB deployment's connection string.
76
const uri =
8-
"mongodb+srv://***REMOVED***/test?retryWrites=true&w=majority";
9-
10-
const client = new MongoClient(uri, {
11-
useNewUrlParser: true,
12-
useUnifiedTopology: true,
13-
});
7+
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
8+
const client = new MongoClient(uri);
149

1510
async function forEachIteration(collection) {
1611
// start foreach cursor example

source/code-snippets/crud/pizza.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
// ignored first line
22
const { MongoClient } = require("mongodb");
33

4-
// Replace the following with your MongoDB deployment's connection
5-
// string.
4+
// Replace the following string with your MongoDB deployment's connection string.
65
const uri =
7-
"mongodb+srv://***REMOVED***/test?retryWrites=true&w=majority";
8-
9-
const client = new MongoClient(uri, {
10-
useNewUrlParser: true,
11-
useUnifiedTopology: true,
12-
});
6+
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
7+
const client = new MongoClient(uri);
138

149
function sleep(ms) {
1510
return new Promise(resolve => setTimeout(resolve, ms));

source/code-snippets/crud/startrek.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
// ignored first line
22
const { MongoClient } = require("mongodb");
33

4-
// Replace the following with your MongoDB deployment's connection
5-
// string.
4+
// Replace the following string with your MongoDB deployment's connection string.
65
const uri =
7-
"mongodb+srv://***REMOVED***/test?retryWrites=true&w=majority";
8-
9-
const client = new MongoClient(uri, {
10-
useNewUrlParser: true,
11-
useUnifiedTopology: true,
12-
});
6+
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
7+
const client = new MongoClient(uri);
138

149
async function word(movies) {
1510
// start word text example

source/code-snippets/crud/theaters.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
// ignored first line
22
const { MongoClient } = require("mongodb");
33

4-
// Replace the following with your MongoDB deployment's connection
5-
// string.
4+
// Replace the following string with your MongoDB deployment's connection string.
65
const uri =
7-
"mongodb+srv://***REMOVED***/test?retryWrites=true&w=majority";
8-
9-
const client = new MongoClient(uri, {
10-
useNewUrlParser: true,
11-
useUnifiedTopology: true,
12-
});
6+
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
7+
const client = new MongoClient(uri);
138

149
async function proximity(theaters) {
1510
// start proximity geo example

0 commit comments

Comments
 (0)