Return count of inserted/updated records for BulkWrite and collection.insertMany( with duplicates)
On success, BulkWrite returns a null response as mentioned in the documentation - https://www.mongodb.com/docs/atlas/app-services/functions/mongodb/api/#collection.bulkwrite--. Can you please send correct response details ( no. of records inserted, no. of records updated ) ? The functionality works correctly but we need correct details returned for debugging issues instead of making a redundant find call to check the results.
When inserting with duplicates, mongo inserts unique records successfully and discards duplicates. However, in the response sent, it does not specify the number of successfully inserted records and the count of duplicates, whereas, this information is returned in normal mongo SDK insert
![](https://secure.gravatar.com/avatar/74b6a1de15228488a9758dfeccadb269?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
shivangani jaiswal commented
Mongo support ticket raised for the same - https://support.mongodb.com/case/00998345