Maven Dependency
<dependency><groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20151123</version>
</dependency>
Conversion
String data; // Xml as a stringfinal JSONObject jsonObject = XML.toJSONObject(data);
doc.put("data", BsonDocument.parse(jsonObject.toString()));
doc.put("rawData", data);
No comments:
Post a Comment