Converting JSON Structure to BasicDBObject

后端 未结 2 1666
说谎
说谎 2021-02-07 10:18

I want to convert the following json structure to BasicDBOject in java and insert into mongo db.

My JSON structure is

{
    \"         


        
2条回答
  •  Happy的楠姐
    2021-02-07 11:08

    com.mongodb.util.JSON.parse 
    

    Is deprecated

    After version 3.6.1 use:

    String json = "{"name": "joe"}";
    Object o = BasicDBObject.parse(json);
    

    Follow here: deprecated-list

提交回复
热议问题