I have questions on InsertManyAsync vs BulkWriteAsync via the NuGet below:
https://www.nuget.org/packages/MongoDB.Driver/2.12.3?_src=template
I want to export 300,000 rows of data around 20 MB, convert them into JSON and import them into Mongo Altas.
My questions:
1 Which operation, InsertManyAsync vs BulkWriteAsync, is transactional, e.g. all or nothing?
2 What is the maximum rows or size allowed for each operation?
The link below or elsewhere don't have the answers:
there is no difference between
InsertManyAsyncandBulkWriteAsyncother than BulkWriteAsync can work not only with insert. In other words,InsertManyAsynccallsBulkWriteAsyncinternally.see transactions. Also, see
ordered/unorderedoption here.I don't think that there is any limitation other then restriction on the document size which is 16 MB. Pay attention that bulk items can be merged into a single document before sending to the server (that should not be bigger 16 MB in sum) or they should be sent separately one by one. This logic depends on whether you use
isOrderedoption and whether all items in your batch are with the same bulk type.