操作Java Mongo工具类的时候,插入Mongo只能用DBObject类型,所以很多时候需要将JSONObject类型转换为DBObject:
DBObject dbObject = (DBObject) JSON.parse(jsonObject.toString());
操作Java Mongo工具类的时候,插入Mongo只能用DBObject类型,所以很多时候需要将JSONObject类型转换为DBObject:
DBObject dbObject = (DBObject) JSON.parse(jsonObject.toString());