I am looking for ways to verify that the data inserted in MongoDB is consistent with the schema, for example. has all the necessary fields and the correct data types. I know that Mongo itself is sketchy, but if I could check the data at the application level before passing it to the Mongo driver, that would be nice.
I looked at JSON-Schema. My biggest hesitation is that I can only find one Java library for checking the schema, and I donβt know if I should trust it, I prefer libraries supported by Apache or Google.
I also looked at Apache Thrift, Avro, and protocol buffers, which are not specific validation frameworks, but each one has a concept of schema. I would be wondering if there is a way to cancel one of them for verification.
Any suggestions? Or should I accept Mongo's schematics and not even try to verify the data?
source share