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 @@ -183,6 +183,8 @@ The method returns a document that contains:
183
183
184
184
- ``upsertedId`` containing the ``_id`` for the upserted document
185
185
186
+ - ``upsertedCount`` containing the number of upserted documents
187
+
186
188
Access Control
187
189
--------------
188
190
@@ -577,7 +579,8 @@ The operation returns:
577
579
"acknowledged" : true,
578
580
"matchedCount" : 0,
579
581
"modifiedCount" : 0,
580
- "upsertedId" : ObjectId("56fc5dcb39ee682bdc609b02")
582
+ "upsertedId" : ObjectId("56fc5dcb39ee682bdc609b02"),
583
+ "upsertedCount": 1
581
584
}
582
585
583
586
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
@@ -661,7 +663,8 @@ Since ``upsert:true`` the document is ``inserted`` based on the ``filter`` and
661
663
"acknowledged" : true,
662
664
"matchedCount" : 0,
663
665
"modifiedCount" : 0,
664
- "upsertedId" : 4
666
+ "upsertedId" : 4,
667
+ "upsertedCount": 1
665
668
}
666
669
667
670
The collection now contains the following documents:
You can’t perform that action at this time.
0 commit comments