Skip to content

Commit 753ba67

Browse files
author
Chris Cho
authored
DOCSP-9029: remove retryWrites from uri connection string (#68)
* DOCSP-9029: remove retryWrites from uri connection string
1 parent 2920ab2 commit 753ba67

31 files changed

+41
-66
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!make
22
MAKEFLAGS += --silent
33

4-
# This allows us to accept extra arguments (by doing nothing when we get a job that doesn't match,
4+
# This allows us to accept extra arguments (by doing nothing when we get a job that doesn't match,
55
# rather than throwing an error).
6-
%:
7-
@:
6+
%:
7+
@:
88

99
# $(MAKECMDGOALS) is the list of "targets" spelled out on the command line
10-
stagel:
10+
stagel:
1111
git clone --quiet https://github.com/mongodb/snooty-scripts.git build_scripts
1212
@ cd build_scripts && npm list mongodb || npm install mongodb
1313
@ source ~/.config/.snootyenv && node build_scripts/app.js $(filter-out $@,$(MAKECMDGOALS))
@@ -25,7 +25,7 @@ repo:
2525
world:
2626
@:
2727

28-
clean:
28+
clean:
2929
rm -rf build
3030

3131
.PHONY: stage

source/code-snippets/connection/srv.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { MongoClient } = require("mongodb");
22

33
// Connection URI
44
const uri =
5-
"mongodb+srv://sample-hostname:27017/?poolSize=20&useUnifiedTopology=true";
5+
"mongodb+srv://sample-hostname:27017/?poolSize=20&w=majority";
66

77
// Create a new MongoClient
88
const client = new MongoClient(uri);

source/code-snippets/crud/arrayFilters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const stream = require("stream");
44

55
// Replace the following string with your MongoDB deployment's connection string.
66
const uri =
7-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
7+
"mongodb+srv://<user>:<password>@<cluster-url>?w=majority";
88
const client = new MongoClient(uri);
99

1010
async function run() {

source/code-snippets/crud/cursor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const stream = require("stream");
44

55
// Replace the following string with your MongoDB deployment's connection string.
66
const uri =
7-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
7+
"mongodb+srv://<user>:<password>@<cluster-url>?w=majority";
88
const client = new MongoClient(uri);
99

1010
async function forEachIteration(collection) {

source/code-snippets/crud/pizza.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { MongoClient } = require("mongodb");
33

44
// Replace the following string with your MongoDB deployment's connection string.
55
const uri =
6-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
6+
"mongodb+srv://<user>:<password>@<cluster-url>?w=majority";
77
const client = new MongoClient(uri);
88

99
function sleep(ms) {

source/code-snippets/crud/startrek.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { MongoClient } = require("mongodb");
33

44
// Replace the following string with your MongoDB deployment's connection string.
55
const uri =
6-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
6+
"mongodb+srv://<user>:<password>@<cluster-url>?w=majority";
77
const client = new MongoClient(uri);
88

99
async function word(movies) {

source/code-snippets/crud/theaters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { MongoClient } = require("mongodb");
33

44
// Replace the following string with your MongoDB deployment's connection string.
55
const uri =
6-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true";
6+
"mongodb+srv://<user>:<password>@<cluster-url>?w=majority";
77
const client = new MongoClient(uri);
88

99
async function proximity(theaters) {

source/code-snippets/indexes/compound.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ const { MongoClient } = require("mongodb");
33
// Replace the following with your MongoDB deployment's connection
44
// string.
55
const uri =
6-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority";
6+
"mongodb+srv://<user>:<password>@<cluster-url>?w=majority";
77

8-
const client = new MongoClient(uri, {
9-
useNewUrlParser: true,
10-
useUnifiedTopology: true,
11-
});
8+
const client = new MongoClient(uri);
129

1310
async function run() {
1411
try {

source/code-snippets/indexes/geo.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ const { MongoClient } = require("mongodb");
33
// Replace the following with your MongoDB deployment's connection
44
// string.
55
const uri =
6-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority";
6+
"mongodb+srv://<user>:<password>@<cluster-url>?w=majority";
77

8-
const client = new MongoClient(uri, {
9-
useNewUrlParser: true,
10-
useUnifiedTopology: true,
11-
});
8+
const client = new MongoClient(uri);
129

1310
async function run() {
1411
try {

source/code-snippets/indexes/multikey.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ const { MongoClient } = require("mongodb");
33
// Replace the following with your MongoDB deployment's connection
44
// string.
55
const uri =
6-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority";
6+
"mongodb+srv://<user>:<password>@<cluster-url>?w=majority";
77

8-
const client = new MongoClient(uri, {
9-
useNewUrlParser: true,
10-
useUnifiedTopology: true,
11-
});
8+
const client = new MongoClient(uri);
129

1310
async function run() {
1411
try {

0 commit comments

Comments
 (0)