-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.4.0-rc7
-
Component/s: None
-
None
-
Query Optimization
MongoDB currently only supports the Draft-04 JSON Schema standard (with some omissions) for validation purposes. Draft-04 is pretty long in the tooth now.
Please enhance JSON Schema validation to support the latest 2019-09 Draft of the standard, specifically including the ability to do conditional subschema validation (ie. if/then/elseĀ keyword support), which can be found here: https://json-schema.org/specification.html
Mongoose provides good support for discriminators, where the structure of a document/subdocument depends on a type field (typically _type), as does Mongoid for subclasses.
Validation of collections that use discriminators is not really possible without support for the if/then/else JSON Schema specification laid outĀ in the most recent draft of the standard.
- is related to
-
SERVER-42035 Extend JSON Schema implementation to support conditional application of subschemas
- Backlog