Performance issue in conversion of json to bson

Please check the corresponding piece of code for your reference:

List documents = new ArrayList<>();

for(int i=0; i< jsonArray.size(); i++) {



The above mentioned code is a snippet from a java function, we take as an argument, a and then inside a loop, we convert each of the json elements, which are very small in size, to corresponding org.bson.Document document and then after the loop is completed, we use the com.mongodb.client.MongoCollection.insertMany method to insert all the above created documents.

Now, the problem which we are facing is that the conversion of json to...

Read More »

By: StackOverFlow - Thursday, 8 November

Related Posts