Hi there i am new with mongodb and i want to convert JSONObject to Document and then store it to mongodb. Here is what i have coded.I get a service api in json.
<
The MongoDB Java Driver provides the Document.parse(String json)
method to get a Document instance from a JSON string. You will need to parse your JSON object back to a String like this:
Document doc = Document.parse( Rat.toString() );
And here's the docs for working with JSON in the MongoDB Java Driver.