Skip to content

Commit d7b599e

Browse files
author
Chris Cho
authored
DOCSP-13620: fix update syntax (#129)
* DOCSP-13620: fix update syntax
1 parent 2149956 commit d7b599e

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

source/fundamentals/connection.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ connect to MongoDB and how it should behave while connected. The following
1515
example shows each part of the connection URI:
1616

1717
.. figure:: /includes/figures/connection_string_parts.png
18-
18+
:alt: Each part of the connection string
1919

2020
In this example, for the protocol, we use ``mongodb+srv`` which specifies the
2121
:manual:`DNS Seedlist Connection Format

source/fundamentals/crud/write-operations/upsert.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ location and want to apply the update. This update might resemble the
3636
following:
3737

3838
.. code-block:: javascript
39+
:emphasize-lines: 2
3940

4041
const query = { name: "Deli Llama" };
41-
const update = { name: "Deli Llama", address: "3 Nassau St" };
42+
const update = { $set: { name: "Deli Llama", address: "3 Nassau St" }};
4243
const options = {};
4344
collection.updateOne(query, update, options);
4445

@@ -53,9 +54,10 @@ update the document, we can set ``upsert`` to ``true`` in our call to
5354
``updateOne()`` as follows:
5455

5556
.. code-block:: javascript
57+
:emphasize-lines: 3
5658

5759
const query = { name: "Deli Llama" };
58-
const update = { name: "Deli Llama", address: "3 Nassau St" };
60+
const update = { $set: { name: "Deli Llama", address: "3 Nassau St" }};
5961
const options = { upsert: true };
6062
collection.updateOne(query, update, options);
6163

@@ -64,6 +66,7 @@ following, whether the "Deli Llama" document existed in your collection
6466
beforehand:
6567

6668
.. code-block:: javascript
69+
:emphasize-lines: 4
6770

6871
[
6972
{ name: "Haute Skillet", address: "42 Avenue B" },

source/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Take the free online course taught by MongoDB
4242

4343
* - .. cssclass:: bordered-figure
4444
.. figure:: /includes/figures/M220JS_hero.jpg
45+
:alt: M220JS course banner
4546

4647
- `M220JS: MongoDB for JavaScript Developers <https://university.mongodb.com/courses/M220JS/about>`_
4748
Learn the essentials of Node.js application development with MongoDB.

source/quick-start.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ This command creates a file called ``package.json``:
6363

6464
npm init -y
6565

66-
.. admonition:: Why the -y?
67-
:class: note
66+
.. note:: Why the -y?
6867

6968
If you specify the ``-y`` option in the command, NPM automatically
7069
accepts the default values for the command. Omit the ``-y`` flag to
@@ -125,12 +124,14 @@ the previous step, log into your Atlas account and navigate to the
125124
want to connect to as shown below.
126125

127126
.. figure:: /includes/figures/atlas_connection_select_cluster.png
127+
:alt: The connect button in the clusters section of the Atlas UI
128128

129129
Proceed to the **Connect Your Application** step and select the Node.js
130130
driver. Select the "Connection String Only" tab and click the **Copy**
131131
button to copy the *connection string* to your clipboard as shown below.
132132

133133
.. figure:: /includes/figures/atlas_connection_copy_string.png
134+
:alt: The connection string copy button in the Connection String Only tab of the Atlas UI
134135

135136
Save your connection string to a safe location that you can access in the
136137
next step.

0 commit comments

Comments
 (0)