How to improve MongoDB insert performance

前端 未结 4 466
粉色の甜心
粉色の甜心 2020-12-24 13:00

The result:

If you are operating on a dataset that is fault tolerant, or doing a one time process you can verify, changing WriteAcknowledge

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 13:32

    Marked answer here is good. I want to add an additional code to help others who use InsertMany instead of BulkWriteAsync to take benefit of IsOrdered = false quicker

        m_Collection.InsertMany(listOfDocument, new InsertManyOptions() { IsOrdered = false });
    

提交回复
热议问题