For Document use the parse() static helper:
Document myDoc = Document.parse(jsonString)
Looks basic and simple: A have a JSON string and I want to store it in MongoDB as JSON document.
In java driver 2.xx I could use com.mongodb.util.JSON.parse(String jsonString) to get DBObject and then store it in collection.
In driver 3.0 JSON.parse still gives DBObject, but rest of API uses org.bson.Document class which looks as incompatible with DBObject.
How to do it in driver version 3.0?
For Document use the parse() static helper:
Document myDoc = Document.parse(jsonString)
[출처] https://stackoverflow.com/questions/29634637/mongodb-java-driver-3-0-how-to-store-json-document
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 6 |
java4autocad Java for Autocad
| 졸리운_곰 | 2017.04.26 | 387 |
| 5 | Java3D and Eclipse | 졸리운_곰 | 2015.08.12 | 317 |
| 4 |
Draw2d Intro
| 졸리운_곰 | 2015.07.29 | 514 |
| 3 |
FreeLayout: A New Java Layout
| 졸리운_곰 | 2015.05.14 | 315 |
| 2 |
XML file to Treeviewer
| 졸리운_곰 | 2015.03.19 | 399 |
| 1 |
Java GUI(AWT) 프로그래밍
| 졸리운_곰 | 2015.03.09 | 938 |