Skip to content

DOCS-505 spelling fix and move example closer to associated sentence #253

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

Merged
merged 1 commit into from
Sep 26, 2012
Merged
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
19 changes: 10 additions & 9 deletions source/reference/method/db.collection.update.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,28 @@ db.collection.update()
accepts parameters in a more clear :term:`document` form to
specify ``multi`` and ``upsert`` options.

The :method:`update() <db.collection.update()>` method provides the ability to
modify an existing document in a collection.
The :method:`update() <db.collection.update()>` method provides the
ability to modify an existing document in a collection.

By default the :method:`update() <db.collection.update()>` method updates a
single document. If you specify a ``multi`` update, the
:method:`update() <db.collection.update()>` method will update all
documents in the collection that match the query criteria. If you
specify ``upsert``, the :method:`update() <db.collection.update()>`
method will insert the document if no document matches the query
criteria, and preform a conventional update otherwise. The
operation has the following form:
criteria; otherwise, it will perform a conventional update.

Before version 2.2, in the :program:`mongo` shell, ``upsert`` and
``multi`` were positional boolean options and the operation has the
following form:

.. code-block:: javascript

db.collection.update(query, update, <upsert,> <multi>)

Before version 2.0, in the :program:`mongo` shell, ``upsert`` and
``multi`` were positional boolean options. Since version 2.2, the
:method:`update() <db.collection.update()>` method can *also* take an
``options`` :term:`document` as a parameter to specify the
``multi`` and the ``upsert`` options.
Since version 2.2, the :method:`update() <db.collection.update()>`
method can *also* take an ``options`` :term:`document` as a
parameter to specify the ``multi`` and the ``upsert`` options.

The :method:`update() <db.collection.update()>` method takes the following
parameters:
Expand Down