I am using Java to implement a function of bulk importing data into MongoDB.
my idea is to read the target content, convert it to a Document object, put it into List, and then import it into the library through the insertMany method of MongoDB Driver. The code is as follows:
but now a performance problem has been found:
:26K+30MB+10
I locate the problem by myself and find that the time-consuming code is a block of circular statements, but I don"t know any other ways to implement it. I also ask you Daniel to give me some advice.