You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(connect): remove references to MongoClient.connect
We want to encourage people to manually create a new MongoClient,
and then call connect, instead of using the static method MongoClient.connect
Fixes NODE-1585
The method updates the first document where the field **a** is equal to **2** by adding a new field **b** to the document set to **1**. Next, update the callback function from **MongoClient.connect** to include the update method.
234
+
The method updates the first document where the field **a** is equal to **2** by adding a new field **b** to the document set to **1**. Next, update the callback function from **client.connect** to include the update method.
Copy file name to clipboardexpand all lines: docs/reference/content/reference/connecting/connection-settings.md
+8-5
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ title = "Connection Settings"
10
10
11
11
# URI Connection Settings
12
12
13
-
Optional connection settings are settings not covered by the [URI Connection String ](https://docs.mongodb.org/manual/reference/connection-string/). The following options are passed in the options parameter in the MongoClient.connect function.
13
+
Optional connection settings are settings not covered by the [URI Connection String ](https://docs.mongodb.org/manual/reference/connection-string/). The following options are passed in the options parameter when you create a mongo client.
The `MongoClient.connect` function returns a `Promise` that we then execute using the `await` keyword inside of an `async` function. If an error happens during the `MongoClient.connect` the error is caught by the `try`/`catch` and can be handled as if it were a normal Javascript error.
39
+
The `client.connect` function returns a `Promise` that we then execute using the `await` keyword inside of an `async` function. If an error happens during the `client.connect` the error is caught by the `try`/`catch` and can be handled as if it were a normal Javascript error.
Copy file name to clipboardexpand all lines: docs/reference/content/reference/faq/index.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ title = "Frequently Asked Questions"
10
10
11
11
# What is the difference between connectTimeoutMS, socketTimeoutMS and maxTimeMS ?
12
12
13
-
| Setting | Default Value MongoClient.connect | Description |
13
+
| Setting | Default Value client.connect | Description |
14
14
| :----------| :------------- | :------------- |
15
15
| connectTimeoutMS | 30000 | The connectTimeoutMS sets the number of milliseconds a socket stays inactive before closing during the connection phase of the driver. That is to say, when the application initiates a connection, when a replica set connects to new members, or when a replica set reconnects to members. A value of 10000 milliseconds would mean the driver would wait up to 10 seconds for a response from a MongoDB server.|
16
16
| socketTimeoutMS | 360000 | The socketTimeoutMS sets the number of milliseconds a socket stays inactive after the driver has successfully connected before closing. If the value is set to 360000 milliseconds, the socket closes if there is no activity during a 6 minutes window.|
@@ -106,12 +106,13 @@ are some things to check:
106
106
allowing the driver to detect that the socket is closed.
107
107
2. The firewall should allow keepAlive probes.
108
108
109
-
# I'm getting ECONNRESET when calling MongoClient.connect
109
+
# I'm getting ECONNRESET when calling client.connect
110
110
This can occur if the connection pool is too large.
0 commit comments