@@ -39,16 +39,16 @@ reconfiguring clients.
3939   To learn how to retrieve your connection string in Atlas, see the
4040   :atlas:`Atlas driver connection guide </driver-connection>`.
4141
42- The next part of the connection string contains your username and password 
42+ The next part of the connection string contains your credentials 
4343if you are using password-based authentication. Replace the value of ``user``
4444with your username and ``pass`` with your password. If you are using an
4545authentication mechanism that does not require a username and password, omit
4646this part of the connection URI.
4747
48- The next part of the connection string specifies the hostname or IP address and 
49- port of  your MongoDB instance. In the example above, we use ``sample.host`` 
50- as the hostname and ``27017`` as the port. Replace these values to point to 
51- your MongoDB instance.
48+ The next part of the connection string specifies the hostname or IP address of 
49+ your MongoDB instance, followed by the port number . In the example above, we use
50+ ``sample.host``  as the hostname and ``27017`` as the port. Replace these values
51+ to point to  your MongoDB instance.
5252
5353The last part of the connection string contains connection and authentication
5454options as parameters. In the example above, we set two connection options:
@@ -57,12 +57,27 @@ options, skip to the :ref:`node-connection-options` section.
5757
5858.. _connect-sample-node-driver:
5959
60- The code below shows how you can use a connection URI in a client to 
61- connect to MongoDB. 
60+ Atlas Connection Example 
61+ ------------------------ 
6262
63- .. literalinclude:: /code-snippets/connection/connect.js
63+ You must create a client to connect to a MongoDB deployment on Atlas. To create
64+ a client, construct an instance of ``MongoClient``, passing in your 
65+ URI and a ``MongoClientOptions`` object.
66+ 
67+ Use the ``serverApi`` option in your ``MongoClientOptions`` object to
68+ enable the {+stable-api+} feature, which forces the server to run operations
69+ with behavior compatible with the specified API version.
70+ 
71+ The following code shows how you can specify the connection string and the
72+ {+stable-api+} client option when connecting to a MongoDB deployment on Atlas and
73+ verify that the connection is successful:
74+ 
75+ .. literalinclude:: /code-snippets/connection/stable-api-connect.js
6476   :language: javascript
6577
78+ To learn more about the Stable
79+ API feature, see the :ref:`{+stable-api+} page <nodejs-stable-api>`.
80+ 
6681.. _node-other-ways-to-connect:
6782
6883Other Ways to Connect to MongoDB
0 commit comments