Skip to content

Fix up some JS formatting #1546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 26 additions & 22 deletions source/reference/method/db.collection.update.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,25 +322,30 @@ includes the ``name`` field set to ``{ first: "Ken", last: "Iverson"
}``.

.. code-block:: javascript

db.bios.update(
{ name: { first: "John", last: "McCarthy" } },
{
name: { first: "Ken", last: "Iverson" },
birth: new Date("Dec 17, 1941"),
died: new Date("Oct 19, 2004"),
contribs: [ "APL", "J" ],
awards: [
{ award: "Turing Award",
year: 1979,
by: "ACM" },
{ award: "Harry H. Goode Memorial Award",
year: 1975,
by: "IEEE Computer Society" },
{ award: "IBM Fellow",
year: 1970,
by: "IBM" }
]
name: { first: "Ken", last: "Iverson" },
birth: new Date("Dec 17, 1941"),
died: new Date("Oct 19, 2004"),
contribs: [ "APL", "J" ],
awards: [
{
award: "Turing Award",
year: 1979,
by: "ACM"
},
{
award: "Harry H. Goode Memorial Award",
year: 1975,
by: "IEEE Computer Society"
},
{
award: "IBM Fellow",
year: 1970,
by: "IBM"
}
]
}
)

Expand All @@ -356,12 +361,11 @@ matches the ``<query>`` parameter:

.. code-block:: javascript

db.books.update( { item: "The New Life" },
{ item: "The New Life",
author: "Dante",
price: 15 },
{ upsert: true }
)
db.books.update(
{ item: "The New Life" },
{ item: "The New Life", author: "Dante", price: 15 },
{ upsert: true }
)

If no document matches the ``<query>`` parameter, the *upsert* inserts
a document with the fields and values of the ``<update>`` parameter and
Expand Down