Intro to Schema
The schema contains JSF props, that together form a model definition of document. Because JSF is written in JSON format, it supports all JSON types and some extra. Each prop can define the following properties:
Type (string, number, array, object, ...).
Validation rules.
Enabled conditions.
If it's array or object type children props.
Handler.
In order to check what type is prop you can use one of the following functions:
isPropNull check if prop type is null.
isPropObject check if prop type is object.
isPropArray check if prop type is array.
isPropString check if prop type is string.
isPropNumber check if prop type is number.
isPropInteger check if prop type is integer.
isPropBoolean check if prop type is boolean.
isPropBinary check if prop type is binary.
isPropId check if prop type is ID compatible with Mongo Object ID.
isPropRef check if prop type is reference.
isPropDate check if prop type is date.
Schema property is required and it must contain one of props. Usually, first level (root) prop is object.
Last updated
Was this helpful?