Skip to content

Commit 2847e54

Browse files
committed
Merge branch 'v6.8' of github.com:mongodb/docs-node into v6.8
2 parents 9dabf3f + 3ed1125 commit 2847e54

15 files changed

+61
-38
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ parameters of the connection URI to specify the behavior of the client.
321321
- ``0``
322322
- Specifies the amount of time, in milliseconds, spent attempting to check out a connection
323323
from a server's connection pool before timing out.
324+
325+
``0`` signifies no timeout.
324326

325327
* - **wTimeoutMS**
326328
- 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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,19 @@ The {+driver-short+} v6.1 release includes the following features:
361361
``Decimal128.fromStringWithRounding()`` method. To learn more, see the
362362
`v6.1.0 bson release notes <https://github.com/mongodb/js-bson/releases/tag/v6.1.0>`__.
363363

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

369370
- ``AWS_STS_REGIONAL_ENDPOINTS``
370371
- ``AWS_REGION``
371372

373+
To learn how to set region settings when using the ``MONGODB-AWS``
374+
authentication mechanism, see the :guilabel:`Web Identity Token` tab in the
375+
:ref:`MONGODB-AWS <mongodb-aws>` section of the Authentication Mechanisms guide.
376+
372377
- Fixes a memory leak issue caused by recursive calls to the ``next()``
373378
method of the ``ChangeStream`` type.
374379

0 commit comments

Comments
 (0)