Skip to content

Commit 905a6bd

Browse files
standardizing change stream example with other usage exs (#65)
1 parent 18315f6 commit 905a6bd

File tree

17 files changed

+71
-78
lines changed

17 files changed

+71
-78
lines changed

source/api-documentation.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

source/api-documentation/.gitkeep

Whitespace-only changes.

source/code-snippets/usage-examples/bulkWrite-example.js

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

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

8-
const client = new MongoClient(uri, { useUnifiedTopology: true });
8+
const client = new MongoClient(uri);
99

1010
async function run() {
1111
try {
@@ -40,7 +40,7 @@ async function run() {
4040
console.log("Number of documents inserted: " + result.nInserted);
4141
} else {
4242
console.log(
43-
"No documents were inserted during the bulk write operation"
43+
"No documents were inserted during the bulk write operation",
4444
);
4545
}
4646

source/code-snippets/usage-examples/command.js

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

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

8-
const client = new MongoClient(uri, { useUnifiedTopology: true });
8+
const client = new MongoClient(uri);
99

1010
async function run() {
1111
try {

source/code-snippets/usage-examples/count.js

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

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

8-
const client = new MongoClient(uri, { useUnifiedTopology: true });
8+
const client = new MongoClient(uri);
99

1010
async function run() {
1111
try {

source/code-snippets/usage-examples/deleteMany.js

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

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

8-
const client = new MongoClient(uri, { useUnifiedTopology: true });
8+
const client = new MongoClient(uri);
99

1010
async function run() {
1111
try {

source/code-snippets/usage-examples/deleteOne.js

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

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

8-
const client = new MongoClient(uri, { useUnifiedTopology: true });
8+
const client = new MongoClient(uri);
99

1010
async function run() {
1111
try {

source/code-snippets/usage-examples/distinct.js

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

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

8-
const client = new MongoClient(uri, { useUnifiedTopology: true });
8+
const client = new MongoClient(uri);
99

1010
async function run() {
1111
try {

source/code-snippets/usage-examples/find.js

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

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

8-
const client = new MongoClient(uri, { useUnifiedTopology: true });
8+
const client = new MongoClient(uri);
99

1010
async function run() {
1111
try {

source/code-snippets/usage-examples/findOne.js

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

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

8-
const client = new MongoClient(uri, { useUnifiedTopology: true });
8+
const client = new MongoClient(uri);
99

1010
async function run() {
1111
try {

0 commit comments

Comments
 (0)