Document.toJson() produces jackson-incompatible mongo extended JSON.
The JSON.serialize method (which produces jackson-compatible JSON) has been deprecated.
Since Jackson is THE standard Java JSON serialization library... If you are writing such a library for Java, then you should consider making Jackson support a priority.
Ideally, this would allow us to use a jackson based library to get a MongoCollection<MyJacksonSerializableObject> directly from the mongo drivers.
The current workaround of getting a MongoCollection<Document>, turning it into Jackson-compatible JSON (via the @deprecated JSON.serialize) and turning that into MyJacksonSerializableObject via an ObjectMapper, though less than ideal, is at least a workable solution. So if the ideal solution is not possible, then please at least include a standard Jackson-compatible JSON serializer.
Some research to support this feature:
- http://visionarysoftware.solutions/visions/java/serialization/examine.html
- http://visionarysoftware.solutions/visions/java/serialization/results.html