File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,8 @@ The method returns a document that contains:
181181
182182- ``upsertedId`` containing the ``_id`` for the upserted document
183183
184+ - ``upsertedCount`` containing the number of upserted documents
185+
184186Access Control
185187--------------
186188
@@ -585,7 +587,8 @@ The operation returns:
585587 "acknowledged" : true,
586588 "matchedCount" : 0,
587589 "modifiedCount" : 0,
588- "upsertedId" : ObjectId("56fc5dcb39ee682bdc609b02")
590+ "upsertedId" : ObjectId("56fc5dcb39ee682bdc609b02"),
591+ "upsertedCount": 1
589592 }
590593
591594The collection now contains the following documents:
Original file line number Diff line number Diff line change @@ -178,7 +178,9 @@ The method returns a document that contains:
178178
179179- ``modifiedCount`` containing the number of modified documents
180180
181- - ``upsertedId`` containing the ``_id`` for the upserted document.
181+ - ``upsertedId`` containing the ``_id`` for the upserted document
182+
183+ - ``upsertedCount`` containing the number of upserted documents
182184
183185- A boolean ``acknowledged`` as ``true`` if the operation ran with
184186 :term:`write concern` or ``false`` if write concern was disabled
@@ -657,7 +659,8 @@ Since ``upsert:true`` the document is ``inserted`` based on the ``filter`` and
657659 "acknowledged" : true,
658660 "matchedCount" : 0,
659661 "modifiedCount" : 0,
660- "upsertedId" : 4
662+ "upsertedId" : 4,
663+ "upsertedCount": 1
661664 }
662665
663666The collection now contains the following documents:
You can’t perform that action at this time.
0 commit comments