… And, since 3.0.0, you can:
import org.bson.Document;
final Document doc = new Document("myKey", "myValue");
final String jsonString = doc.toJson();
final Document doc = Document.parse(jsonString);
Official docs:
More Related Contents:
- JSON order mixed up
- Converting Java objects to JSON with Jackson
- Keep the order of the JSON keys during JSON conversion to CSV
- Http 415 Unsupported Media type error with JSON
- ‘Field required a bean of type that could not be found.’ error spring restful API using mongodb
- org.codehaus.jackson versus com.fasterxml.jackson.core
- How to convert List to Json in Java
- How to solve circular reference in json serializer caused by hibernate bidirectional mapping?
- directly convert CSV file to JSON file using the Jackson library
- Why I’m not able to unwrap and serialize a Java map using the Jackson Java library?
- Jackson dynamic property names
- JSON parameter in spring MVC controller
- JSON consumer of polymorphic objects
- How to serialize only the ID of a child with Jackson
- How can I parse this JSON in Android?
- How to do a Mongo aggregation query in Spring Data?
- Issue with parsing the content from JSON file with Jackson & message- JsonMappingException -Cannot deserialize as out of START_ARRAY token
- how to send array of params using volley in android
- How to convert list data into json in java
- Ignoring property when deserializing
- How to return JSON data from spring Controller using @ResponseBody
- Jackson JSON custom serialization for certain fields
- Importing JSON into an Eclipse project
- Want to hide some fields of an object that are being mapped to JSON by Jackson
- How do I convert from YAML to JSON in Java?
- How to tell Jackson to ignore empty object during deserialization?
- How do you configure Embedded MongDB for integration testing in a Spring Boot application?
- Using gson to deserialize specific JSON field of an object
- How to use @JsonIdentityInfo with circular references?
- How to use Postgres JSONB datatype with JPA?