Skip to content

Commit a8d7040

Browse files
authored
[docsp-26162] Remove unsupported options (#463)
* initial * rr suggestion
1 parent 72be9c1 commit a8d7040

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

source/code-snippets/transactions/txn-callback.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function setup(client) {
3333

3434
async function queryData() {
3535
const uri = process.env.MONGODB_URI;
36-
const client = new MongoClient(uri, { useUnifiedTopology: true });
36+
const client = new MongoClient(uri);
3737
try {
3838
await Promise.all(['customers', 'inventory', 'orders'].map(async c => {
3939
const coll = client.db('testdb').collection(c);
@@ -91,7 +91,7 @@ async function placeOrder(client, session, cart, payment) {
9191
// end callback
9292

9393
const uri = process.env.MONGODB_URI;
94-
const client = new MongoClient(uri, { useUnifiedTopology: true });
94+
const client = new MongoClient(uri);
9595

9696
async function run() {
9797
/* Test code: uncomment block to run

source/code-snippets/transactions/txn-core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function setup(client) {
2828

2929
async function queryData() {
3030
const uri = process.env.MONGODB_URI;
31-
const client = new MongoClient(uri, { useUnifiedTopology: true });
31+
const client = new MongoClient(uri);
3232
try {
3333
await Promise.all(['customers', 'inventory', 'orders'].map(async c => {
3434
const coll = client.db('testdb').collection(c);
@@ -112,7 +112,7 @@ async function placeOrder(client, cart, payment) {
112112

113113
async function run() {
114114
const uri = process.env.MONGODB_URI;
115-
const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true });
115+
const client = new MongoClient(uri);
116116

117117
await cleanUp(client);
118118
await setup(client);

source/fundamentals/crud/write-operations/pkFactory.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ generate ``_id`` values of type ``uuid``:
5151
const { UUID } = require('bson');
5252
...
5353
const client = new MongoClient(uri, {
54-
useUnifiedTopology: true,
5554
pkFactory: { createPk: () => new UUID().toBinary() }
5655
});
5756

source/whats-new.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ to get your app up and running in a correct state quickly.
385385
a function. Now, the argument must be a function. Specifying a
386386
boolean will result in an error being thrown.
387387

388-
- It is longer required to specify ``useUnifiedTopology`` or ``useNewUrlParser``.
388+
- It is no longer required to specify ``useUnifiedTopology`` or ``useNewUrlParser``.
389389

390390
``createCollection()``
391391
++++++++++++++++++++++
@@ -555,7 +555,7 @@ Unified Topology
555555
to a ``mongod``. The differences between this and previous versions
556556
is `detailed here <https://mongodb.github.io/node-mongodb-native/3.6/reference/unified-topology/>`__.
557557

558-
- It is longer required to specify ``useUnifiedTopology`` or ``useNewUrlParser``.
558+
- It is no longer required to specify ``useUnifiedTopology`` or ``useNewUrlParser``.
559559

560560
- You must use the new ``directConnection`` `option <{+api+}/interfaces/MongoClientOptions.html#directConnection>`__
561561
to connect to uninitialized replica set members.

0 commit comments

Comments
 (0)