I have the following use case -
- Store a JSON schema (dynamic, changes over time) in mongodb.
- Read JSON objects from a file and validate them against the schema (in #1)
- I am using this JSON Validator.
- I need to read the schema from mongo db and convert it to JsonNode (Jackson library).
I am using Java..
Can anyone let me know how to convert a mongodb document to JsonNode.. I need this because the validator I am using (mentioned in #3 above) needs a JsonNode to construct the schema object.
EDIT: Is it fine performance wise to convert DBObject to JSON string and then convert it to JsonNode?