It looks simple and simple: there is a JSON string, and I want to save it in MongoDB as a JSON document.
In java driver 2.xx, I could use com.mongodb.util.JSON.parse(String jsonString) to get a DBObject and then save it to the collection.
In driver 3.0, JSON.parse still provides DBObject, but the rest of the API uses the org.bson.Document class, which looks incompatible with DBObject.
How to do this in version 3.0 for drivers?
source share