Skip to content

Commit 7c68dc7

Browse files
committed
Merge branch 'v6.9' of github.com:mongodb/docs-node into v6.9
2 parents 48b70a2 + 6c0a22d commit 7c68dc7

15 files changed

+78
-40
lines changed

source/code-snippets/indexes/text.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ async function run() {
1717
// Create a text index on the "title" and "body" fields
1818
const result = await myColl.createIndex(
1919
{ title: "text", body: "text" },
20-
{ default_language: "english" },
21-
{ weights: { body: 10, title: 3 } }
20+
{
21+
default_language: "english",
22+
weights: { body: 10, title: 3 }
23+
}
2224
);
2325
// end-idx
2426
console.log(`Index created: ${result}`);

source/faq.txt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,9 @@ What Is the Difference Between "connectTimeoutMS", "socketTimeoutMS" and "maxTim
122122
<node-connection-options>` that sets the time, in milliseconds,
123123
for an individual connection from your connection pool to
124124
establish a TCP connection to the {+mdb-server+} before
125-
timing out.
126-
127-
.. tip::
128-
129-
To modify the allowed time for `MongoClient.connect <{+api+}/classes/MongoClient.html#connect>`__ to establish a
130-
connection to a {+mdb-server+}, use the ``serverSelectionTimeoutMS`` option instead.
125+
timing out. To modify the allowed time for
126+
`MongoClient.connect <{+api+}/classes/MongoClient.html#connect>`__ to establish a
127+
connection to a {+mdb-server+}, use the ``serverSelectionTimeoutMS`` option instead.
131128

132129
**Default:** 30000
133130
* - **socketTimeoutMS**
@@ -170,9 +167,7 @@ What Happens to Running Operations if the Client Disconnects?
170167

171168
Starting in {+mdb-server+} version 4.2, the server terminates
172169
running operations such as aggregations and find operations if the
173-
client disconnects. To see a full list of operations affected by this
174-
behavior, see the :manual:`Server version 4.2 release notes
175-
</release-notes/4.2/#client-disconnection>` in the Server manual.
170+
client disconnects.
176171

177172
Other operations, such as write operations, continue to run on the
178173
{+mdb-server+} even if the client disconnects. This behavior can cause data

source/fundamentals/authentication/mechanisms.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,29 @@ The driver checks for your credentials in the following sources in order:
229229

230230
export AWS_WEB_IDENTITY_TOKEN_FILE=<absolute path to file containing your OIDC token>
231231

232-
After you've set the preceding environment variable, specify the ``MONGODB-AWS``
232+
AWS recommends using regional AWS STS endpoints instead of global
233+
endpoints to reduce latency, build-in redundancy, and increase session token validity.
234+
To set the AWS region, set `AWS_REGION <https://docs.aws.amazon.com/sdkref/latest/guide/feature-region.html>`__
235+
and `AWS_STS_REGIONAL_ENDPOINTS <https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html>`__
236+
as environment variables, as shown in the following example:
237+
238+
.. code-block:: bash
239+
240+
export AWS_STS_REGIONAL_ENDPOINTS=regional // Enables regional endpoints
241+
export AWS_REGION=us-east-1 // Sets your AWS region
242+
243+
If both these environment variables aren't set, the default region is
244+
``us-east-1``. For a list of available AWS regions, see the
245+
`Regional Endpoints <https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints>`__
246+
section of the AWS Service Endpoints reference in the AWS documentation.
247+
248+
.. warning:: Consult your SDK's Documentation for Setting an AWS Region
249+
250+
You cannot set your AWS region with environment variables for all SDKs,
251+
as in the above example. See your SDK's specific documentation for
252+
configuring an AWS region.
253+
254+
After you've set the preceding environment variables, specify the ``MONGODB-AWS``
233255
authentication mechanism in your connection string as shown in the following example:
234256

235257
.. literalinclude:: /code-snippets/authentication/aws-env-variable.js

source/fundamentals/connection/connection-options.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ parameters of the connection URI to specify the behavior of the client.
5353
- ``null``
5454
- Specifies the database that connections authenticate against.
5555

56+
* - **autoSelectFamily**
57+
- boolean
58+
- ``true``
59+
- If set to ``true``, the socket attempts to connect to IPv6 and IPv4 addresses
60+
until a connection is established. If available, the driver will select
61+
the first IPv6 address.
62+
63+
* - **autoSelectFamilyAttemptTimeout**
64+
- non-negative integer
65+
- ``null``
66+
- Specifies the amount of time in milliseconds to wait for a connection
67+
attempt to finish before trying the next address when using the
68+
``autoSelectFamily`` option. If set to a positive integer less than ``10``,
69+
the value ``10`` is used instead.
70+
5671
* - **compressors**
5772
- comma separated list of strings, for example, "snappy,zlib,zstd"
5873
- ``null``
@@ -321,6 +336,8 @@ parameters of the connection URI to specify the behavior of the client.
321336
- ``0``
322337
- Specifies the amount of time, in milliseconds, spent attempting to check out a connection
323338
from a server's connection pool before timing out.
339+
340+
``0`` signifies no timeout.
324341

325342
* - **wTimeoutMS**
326343
- non-negative integer

source/fundamentals/connection/network-compression.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ by specifying the algorithms in one of two ways:
5555
.. tab:: MongoClientOptions
5656
:tabid: mongoclientoptions
5757

58-
To enable compression using the `MongoClientOptions <{+api+}/api/global.html#MongoClientOptions>`__,
58+
To enable compression using the `MongoClientOptions <{+api+}/interfaces/MongoClientOptions.html>`__,
5959
pass the ``compressors`` option and the compression
6060
algorithm you want to use. You can specify one or more compression
6161
algorithms, separating them with commas:

source/fundamentals/indexes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ List Indexes
7171
You can use the ``listIndexes()`` method to list all the indexes
7272
for a collection. The `listIndexes() <{+api+}/classes/Collection.html#listIndexes>`__ method takes an
7373
optional `ListIndexesOptions
74-
<{+api+}/interfaces/ListIndexesOptions.html>`__ parameter. The ``listIndexes()`` method returns an
74+
<{+api+}/types/ListIndexesOptions.html>`__ parameter. The ``listIndexes()`` method returns an
7575
object of type `ListIndexesCursor
7676
<{+api+}/classes/ListIndexesCursor.html>`__.
7777

source/fundamentals/run-command.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _node-run-command:
22

3-
=============
3+
==============
44
Run a Command
5-
=============
5+
==============
66

77
.. contents:: On this page
88
:local:
@@ -141,12 +141,9 @@ with the following fields:
141141

142142
* - ``operationTime``
143143
- Indicates the logical time of the operation. MongoDB uses the
144-
logical time to order operations.
145-
146-
.. seealso::
147-
148-
To learn more about logical time, see our :website:`blog post about
149-
the Global Logical Clock </blog/post/transactions-background-part-4-the-global-logical-clock>`.
144+
logical time to order operations.
145+
To learn more about logical time, see our
146+
:website:`blog post about the Global Logical Clock </blog/post/transactions-background-part-4-the-global-logical-clock>`.
150147

151148
* - ``$clusterTime``
152149
- Provides a document that returns the signed cluster time. Cluster time is a

source/fundamentals/transactions.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ the Convenient Transaction API:
208208
To see a fully runnable example that uses this API, see the
209209
:ref:`node-usage-convenient-txn` usage example.
210210

211+
.. sharedinclude:: dbx/transactions-parallelism.rst
212+
211213
.. _nodejs-transaction-settings:
212214

213215
Transaction Options
162 KB
Loading
Loading
Binary file not shown.
Binary file not shown.

source/quick-start/create-a-connection-string.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,32 @@ To connect to an instance or deployment not hosted on Atlas, see
2424
To retrieve your connection string for the deployment that
2525
you created in the :ref:`previous step <node-quick-start-create-deployment>`,
2626
log into your Atlas account and navigate to the
27-
:guilabel:`Database` section and click the :guilabel:`Connect` button
27+
:guilabel:`Clusters` section and click the :guilabel:`Connect` button
2828
for your new deployment.
2929

30-
.. figure:: /includes/figures/atlas_connection_select_cluster.png
30+
.. figure:: /includes/figures/atlas_connect.png
3131
:alt: The connect button in the clusters section of the Atlas UI
3232

33-
Proceed to the :guilabel:`Connect your application` section and select
34-
"Node.js" from the :guilabel:`Driver` selection menu and the version
33+
Select the :guilabel:`Drivers` option from the :guilabel:`Connect to your application`
34+
section. Then in the :guilabel:`Connecting with MongoDB Driver`
35+
menu, select "Node.js" from the :guilabel:`Driver` selection menu and the version
3536
that best matches the version you installed from the :guilabel:`Version`
3637
selection menu.
3738

3839
Select the :guilabel:`Password (SCRAM)` authentication mechanism.
39-
40-
Deselect the :guilabel:`Include full driver code example` to view
41-
the connection string.
4240

4341
.. step:: Copy your Connection String
4442

4543
Click the button on the right of the connection string to copy it to
4644
your clipboard as shown in the following screenshot:
4745

48-
.. figure:: /includes/figures/atlas_connection_copy_string_node.png
46+
.. figure:: /includes/figures/atlas_connection_copy_string.png
4947
:alt: The connection string copy button in the Atlas UI
5048

5149
.. step:: Update the Placeholders
5250

5351
Paste this connection string into a a file in your preferred text editor
54-
and replace the "<username>" and "<password>" placeholders with
52+
and replace the "<db_username>" and "<db_password>" placeholders with
5553
your database user's username and password.
5654

5755
Save this file to a safe location for use in the next step.

source/usage-examples/command.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
.. meta::
88
:keywords: code example, multiple, modify, customize, debug
99

10-
=============
11-
Run a Command
12-
=============
10+
=====================
11+
Run a Command Example
12+
=====================
1313

1414
You can execute database commands by using the
1515
`command() <{+api+}/classes/Db.html#command>`__ method on a ``Db``

source/whats-new.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ What's New in 6.9
8383
- Adds official support for Queryable Encryption (QE) range queries. To use this
8484
feature, your app must use ``mongodb-client-encryption`` v6.1.0 or later and must connect
8585
to {+mdb-server+} 8.0 or later. For more information about QE range queries, see
86-
:manual:`Queryable Encryption <core/queryable-encryption>` in the {+mdb-server+} manual.
86+
:manual:`Queryable Encryption </core/queryable-encryption>` in the {+mdb-server+} manual.
8787

8888
- The ``insertMany()`` and ``bulkWrite()`` methods accept ``ReadonlyArray`` inputs.
8989

@@ -450,14 +450,19 @@ The {+driver-short+} v6.1 release includes the following features:
450450
``Decimal128.fromStringWithRounding()`` method. To learn more, see the
451451
`v6.1.0 bson release notes <https://github.com/mongodb/js-bson/releases/tag/v6.1.0>`__.
452452

453-
- Detects environment variables for region settings when
454-
authenticating by using the ``MONGODB-AWS`` authentication mechanism.
455-
To instruct the driver to use your region options, you must set both
456-
of the following environment variables:
453+
- Detects environment variables for region settings when you
454+
authenticate by using the `IAM AssumeRoleWithWebIdentity action
455+
<https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html>`__
456+
with ``MONGODB-AWS`` authentication. To instruct the driver to use your region options,
457+
you must set both of the following environment variables:
457458

458459
- ``AWS_STS_REGIONAL_ENDPOINTS``
459460
- ``AWS_REGION``
460461

462+
To learn how to set region settings when using the ``MONGODB-AWS``
463+
authentication mechanism, see the :guilabel:`Web Identity Token` tab in the
464+
:ref:`MONGODB-AWS <mongodb-aws>` section of the Authentication Mechanisms guide.
465+
461466
- Fixes a memory leak issue caused by recursive calls to the ``next()``
462467
method of the ``ChangeStream`` type.
463468

@@ -540,4 +545,4 @@ The {+driver-short+} v6.0 release includes the following features:
540545
<node-command-options>` section of the Run a Command guide.
541546

542547
To learn more about this release, see the
543-
`v6.0.0 Release Highlights <https://github.com/mongodb/node-mongodb-native/releases/tag/v6.0.0>`__.
548+
`v6.0.0 Release Highlights <https://github.com/mongodb/node-mongodb-native/releases/tag/v6.0.0>`__.

0 commit comments

Comments
 (0)