preaction / Yancy

The Best Web Framework Deserves the Best Content Management System
http://preaction.me/yancy/
Other
54 stars 21 forks source link

Mongo DB schema-getting #30

Open mohawk2 opened 6 years ago

mohawk2 commented 6 years ago

I gather the roadblock for supporting MongoDB is implementing read_schema. If so, I believe the way forward is to have the implementing method check the DB for whether there is a configured schema: https://docs.mongodb.com/manual/core/schema-validation/

If not, die. If so, just read the schema and use that. Does that accord with your thoughts?

preaction commented 6 years ago

I mostly concur, though I was thinking instead of die when we see something without a valid JSON schema, we read the collection names and configure them as just type => 'object'. Then people would still be able to edit the raw JSON object in the editor (indeed we could do multiple things to make that nicer, including showing the raw JSON by default and support for additionalProperties in the editor).