Skip to content

Commit 565d231

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCS-16428-upsert-n (#5074) (#5094)
* 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 348064c commit 565d231

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

11411141
.. data:: update.n
11421142

1143-
The number of documents selected for update. If the update operation
1143+
An ``update`` command accepts an array of document updates, some of
1144+
which can be :term:`upserts <upsert>`. For an update, ``n`` is the
1145+
number of documents selected for the update. For an upsert, ``n`` is
1146+
``1`` for the inserted document. The server adds the ``n`` values for
1147+
all the updates and upserts and returns the total as ``update.n``.
1148+
1149+
If an update operation
11441150
results in no change to the document, e.g. :update:`$set` expression
11451151
updates the value to the current value, :data:`~update.n` can be
11461152
greater than :data:`~update.nModified`.

0 commit comments

Comments
 (0)