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:
181
181
182
182
- ``upsertedId`` containing the ``_id`` for the upserted document
183
183
184
+ - ``upsertedCount`` containing the number of upserted documents
185
+
184
186
Access Control
185
187
--------------
186
188
@@ -585,7 +587,8 @@ The operation returns:
585
587
"acknowledged" : true,
586
588
"matchedCount" : 0,
587
589
"modifiedCount" : 0,
588
- "upsertedId" : ObjectId("56fc5dcb39ee682bdc609b02")
590
+ "upsertedId" : ObjectId("56fc5dcb39ee682bdc609b02"),
591
+ "upsertedCount": 1
589
592
}
590
593
591
594
The 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:
178
178
179
179
- ``modifiedCount`` containing the number of modified documents
180
180
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
182
184
183
185
- A boolean ``acknowledged`` as ``true`` if the operation ran with
184
186
: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
657
659
"acknowledged" : true,
658
660
"matchedCount" : 0,
659
661
"modifiedCount" : 0,
660
- "upsertedId" : 4
662
+ "upsertedId" : 4,
663
+ "upsertedCount": 1
661
664
}
662
665
663
666
The collection now contains the following documents:
You can’t perform that action at this time.
0 commit comments