@@ -11,27 +11,28 @@ db.collection.update()
11
11
accepts parameters in a more clear :term:`document` form to
12
12
specify ``multi`` and ``upsert`` options.
13
13
14
- The :method:`update() <db.collection.update()>` method provides the ability to
15
- modify an existing document in a collection.
14
+ The :method:`update() <db.collection.update()>` method provides the
15
+ ability to modify an existing document in a collection.
16
16
17
17
By default the :method:`update() <db.collection.update()>` method updates a
18
18
single document. If you specify a ``multi`` update, the
19
19
:method:`update() <db.collection.update()>` method will update all
20
20
documents in the collection that match the query criteria. If you
21
21
specify ``upsert``, the :method:`update() <db.collection.update()>`
22
22
method will insert the document if no document matches the query
23
- criteria, and preform a conventional update otherwise. The
24
- operation has the following form:
23
+ criteria; otherwise, it will perform a conventional update.
24
+
25
+ Before version 2.2, in the :program:`mongo` shell, ``upsert`` and
26
+ ``multi`` were positional boolean options and the operation has the
27
+ following form:
25
28
26
29
.. code-block:: javascript
27
30
28
31
db.collection.update(query, update, <upsert,> <multi>)
29
32
30
- Before version 2.0, in the :program:`mongo` shell, ``upsert`` and
31
- ``multi`` were positional boolean options. Since version 2.2, the
32
- :method:`update() <db.collection.update()>` method can *also* take an
33
- ``options`` :term:`document` as a parameter to specify the
34
- ``multi`` and the ``upsert`` options.
33
+ Since version 2.2, the :method:`update() <db.collection.update()>`
34
+ method can *also* take an ``options`` :term:`document` as a
35
+ parameter to specify the ``multi`` and the ``upsert`` options.
35
36
36
37
The :method:`update() <db.collection.update()>` method takes the following
37
38
parameters:
0 commit comments