Problem with using BasicDBObject.parse as a alternative to Json.parse

Hi Team,

In our application we are using 3.11 mongo driver, would like migrate to 4.0 driver. There were some com.mongodb.util.JSON class got removed, proposed to use BasicDBObject.parse as an alternative for that. When we use BasicDBObject.parse we are not getting expected results as eariler api.

ex 1: Suppose if we need to parse the text

String testString = “‘text’”
When we use old api(Json.parse) result is text but with new Api (BasicDBObject.parse) it is resulting ‘text’.

ex 2: Suppose if we pass array to parse
Old Api : it is returning List as returning as a result.
Proposed api : It is return array as String.

ex 3: com.mongodb.util.JSON class havin a method Json.parse(“String”, callback). In 4.0 haven’t find any alternative.

Kindly suggest alternatives for above api.

Thanks & Regards,
Venkata krishna Tolusuri