In Moon Modeler, the visualization of the database structure shows how the data is physically stored in MongoDB.
Conditions, operators and custom code
If you want to define the schema using if, then, else conditions (e.g. to ensure that the zip code is defined with a correct pattern for a given country) and use operators like oneOf, anyOf, allOf, etc., you can write this advanced definition manually in the Collection details, in the Script section.
In this section, you can turn off Include collection in generated script (1) and turn on using your own Custom code (2) into the resulting script that is generated for the entire project.
Visual creation of schema elements such as conditions and operators is not currently supported, however improvements are in our roadmap.
Script generation
To generate a MongoDB schema validation script from your project, click the Script icon on the main toolbar. A preview of the script will appear in the modal form.
For more information about MongoDB schema validation, visit
https://docs.mongodb.com/manual/core/schema-validation/
#