Skip to content

Commit 1dbe5b8

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCS-16428-upsert-n (#5074) (#5092)
* DOCS-16428-upsert-n * DOCS-16428-upsert-n * DOCS-16428-upsert-n * DOCS-16428-upsert-n * DOCS-16428-upsert-n --------- Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 2eeab2f commit 1dbe5b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/reference/command/update.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,13 @@ The returned document contains a subset of the following fields:
11691169

11701170
.. data:: update.n
11711171

1172-
The number of documents selected for update. If the update operation
1172+
An ``update`` command accepts an array of document updates, some of
1173+
which can be :term:`upserts <upsert>`. For an update, ``n`` is the
1174+
number of documents selected for the update. For an upsert, ``n`` is
1175+
``1`` for the inserted document. The server adds the ``n`` values for
1176+
all the updates and upserts and returns the total as ``update.n``.
1177+
1178+
If an update operation
11731179
results in no change to the document, e.g. :update:`$set` expression
11741180
updates the value to the current value, :data:`~update.n` can be
11751181
greater than :data:`~update.nModified`.

0 commit comments

Comments
 (0)