mongoengine
mongoengine copied to clipboard
Exporting Document as JSON schema
Hi,
Is it possible to export a MongoEngine Document as a mongo-friendly JSON schema? It might be quite helpful for writing migrations and ensuring that the collection has exactly the data it should have without a bunch of corner cases.
The workflow is approximately like: write the model -> get the schema -> plug it into mongo with Warning level -> adjust -> deploy -> switch to Strict level -> repeat
@upcFrost I have written a package that adds this functionality to MongoEngine documents. Check it out here: https://github.com/symphonicityy/mongoengine-jsonschema