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 @@ -185,6 +185,8 @@ The method returns a document that contains:
185
185
186
186
- ``upsertedId`` containing the ``_id`` for the upserted document
187
187
188
+ - ``upsertedCount`` containing the number of upserted documents
189
+
188
190
Access Control
189
191
--------------
190
192
@@ -589,7 +591,8 @@ The operation returns:
589
591
"acknowledged" : true,
590
592
"matchedCount" : 0,
591
593
"modifiedCount" : 0,
592
- "upsertedId" : ObjectId("56fc5dcb39ee682bdc609b02")
594
+ "upsertedId" : ObjectId("56fc5dcb39ee682bdc609b02"),
595
+ "upsertedCount": 1
593
596
}
594
597
595
598
The collection now contains the following documents:
Original file line number Diff line number Diff line change @@ -180,7 +180,9 @@ The method returns a document that contains:
180
180
181
181
- ``modifiedCount`` containing the number of modified documents
182
182
183
- - ``upsertedId`` containing the ``_id`` for the upserted document.
183
+ - ``upsertedId`` containing the ``_id`` for the upserted document
184
+
185
+ - ``upsertedCount`` containing the number of upserted documents
184
186
185
187
- A boolean ``acknowledged`` as ``true`` if the operation ran with
186
188
:term:`write concern` or ``false`` if write concern was disabled
@@ -659,7 +661,8 @@ Since ``upsert:true`` the document is ``inserted`` based on the ``filter`` and
659
661
"acknowledged" : true,
660
662
"matchedCount" : 0,
661
663
"modifiedCount" : 0,
662
- "upsertedId" : 4
664
+ "upsertedId" : 4,
665
+ "upsertedCount": 1
663
666
}
664
667
665
668
The collection now contains the following documents:
You can’t perform that action at this time.
0 commit comments