There are multiple tutorials like this and this which describes saving JSON data using JSON.parse method which returns DBObject. Though it is very simple and brief way of saving JSON data what I wonder is why is there a need to parse the JSON? Can I not directly save my JSON string directly to Mongo without parsing, I see that the mongo shell can do that.
The reason I ask this is because I have thousands of documents in chunks and I may save time by not parsing data!
In a nutshell is there a java method of following form in some drivers
Collection coll = new Collection("mycollection");
coll.save("[{datakey1:dataval1},{datakey2:datavalue2},...]");
Base on your use case, if you insert a list of DBObject, it will actually result in multiple document in mongodb. This seems to be a strange use case for MongoDB, it could be stored like this:
You should only do this if you never intended to query the json data, which is what Mongo is good at. This sounds like the case because the json data was stored in a RDBMS field.