@@ -157,7 +157,7 @@ when applicable, and connection options.
157
157
Click the button on the right of the connection string to copy it to
158
158
your clipboard, as shown in the following screenshot:
159
159
160
- .. figure:: /includes/figures/atlas_connection_copy_string_node .png
160
+ .. figure:: /includes/figures/atlas_connection_copy_uri_node .png
161
161
:alt: The connection string copy button in the Atlas UI
162
162
163
163
.. step:: Update the placeholders
@@ -169,7 +169,7 @@ when applicable, and connection options.
169
169
Save this file to a safe location for use in the next section.
170
170
171
171
After completing these steps, you have a connection string that
172
- contains your database username, database password, and database name .
172
+ contains your database username and password .
173
173
174
174
.. _node-quick-start-connect-to-mongodb:
175
175
.. _node-get-started-connect-to-mongodb:
@@ -191,7 +191,7 @@ Connect to MongoDB
191
191
192
192
const { MongoClient } = require("mongodb");
193
193
194
- // Replace the uri string with your connection string.
194
+ // Replace the uri string with your connection string
195
195
const uri = "<connection string uri>";
196
196
197
197
const client = new MongoClient(uri);
@@ -201,13 +201,12 @@ Connect to MongoDB
201
201
const database = client.db('sample_mflix');
202
202
const movies = database.collection('movies');
203
203
204
- // Query for a movie that has the title 'Back to the Future'
204
+ // Queries for a movie that has a title value of 'Back to the Future'
205
205
const query = { title: 'Back to the Future' };
206
206
const movie = await movies.findOne(query);
207
207
208
208
console.log(movie);
209
209
} finally {
210
- // Ensures that the client will close when you finish/error
211
210
await client.close();
212
211
}
213
212
}
@@ -246,7 +245,7 @@ Connect to MongoDB
246
245
sample data.
247
246
248
247
After you complete these steps, you have a working application that
249
- uses the driver to connect to your MongoDB deployment, run a query on
248
+ uses the driver to connect to your MongoDB deployment, query
250
249
the sample data, and print out the result.
251
250
252
251
.. _node-quick-start-next-steps:
@@ -265,8 +264,8 @@ and retrieves a document that matches a query.
265
264
266
265
Learn more about the {+driver-short+} from the following resources:
267
266
268
- - Discover how to perform read and write operations in the
269
- :ref:`CRUD Operations <node-crud-landing >` section.
267
+ - Discover how to configure your MongoDB connection in the
268
+ :ref:`Connect to MongoDB <node-connect >` section.
270
269
271
- - See examples of frequently-used operations in the
272
- :ref:`Usage Examples <node-usage-examples >` section.
270
+ - Discover how to perform read and write operations in the
271
+ :ref:`CRUD Operations <node-crud-landing >` section.
0 commit comments