Skip to content

Commit b88ae3f

Browse files
committed
KA fixes 2
1 parent c6eb9d1 commit b88ae3f

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

source/fundamentals/connection.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ connect to a MongoDB deployment. It instructs the driver on how it should
2222
connect to MongoDB and how it should behave while connected. The following
2323
example explains each part of a sample connection URI:
2424

25-
.. figure:: /includes/figures/connection_string_parts.png
25+
.. figure:: /includes/figures/connection_uri_parts.png
2626
:alt: Each part of the connection string
2727

2828
In this example, we use ``mongodb`` for the protocol, which specifies the
@@ -148,12 +148,20 @@ URI to specify the behavior of the client.
148148
- Specifies the maximum number of connections that a connection pool may
149149
have at a given time.
150150

151+
* - **replicaSet**
152+
- string
153+
- ``null``
154+
- Specifies the replica set name for the cluster. All nodes in the
155+
replica set must have the same replica set name, or the Client will not
156+
consider them as part of the set.
157+
151158
* - **maxIdleTimeMS**
152159
- integer
153160
- ``0``
154161
- Specifies the maximum amount of time a connection can remain idle
155-
in the connection pool before being removed and closed. The ``0``
156-
default value indicates that there is no idle time allowance.
162+
in the connection pool before being removed and closed. The
163+
default is ``0``, meaning a connection can remain unused
164+
indefinitely.
157165

158166
* - **minPoolSize**
159167
- integer
Binary file not shown.

source/includes/fundamentals/code-snippets/srv.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
// Connection URI
14-
const uri = "mongodb+srv://sample-hostname/?maxPoolSize=20&w=majority"
14+
const uri = "mongodb://user:pass@sample.host:27017/?maxPoolSize=20&w=majority"
1515

1616
func main() {
1717
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)

0 commit comments

Comments
 (0)