Skip to content

Commit 4852a1b

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCS-16428-upsert-n (#5074) (#5093)
* 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 11b9f7c commit 4852a1b

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
@@ -1173,7 +1173,13 @@ The returned document contains a subset of the following fields:
11731173

11741174
.. data:: update.n
11751175

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

0 commit comments

Comments
 (0)