SchemaField model class, usually used as part of the Schema model.

Hierarchy

Implements

Constructors

Methods

  • InitOptions initializes the current field options based on its type.

    Returns error on unknown field type.

    Returns void

  • PrepareValue returns normalized and properly formatted field value.

    Parameters

    • value: any

    Returns any

  • PrepareValueWithModifier returns normalized and properly formatted field value by "merging" baseValue with the modifierValue based on the specified modifier (+ or -).

    Parameters

    • baseValue: any
    • modifier: string
    • modifierValue: any

    Returns any

  • UnmarshalJSON implements the [json.Unmarshaler] interface.

    The schema field options are auto initialized on success.

    Parameters

    • data: string | number[]

    Returns void

  • Validate makes SchemaField validatable by implementing [validation.Validatable] interface.

    Returns void

Properties

id: string
name: string
options: any
presentable: boolean

Presentable indicates whether the field is suitable for visualization purposes (eg. in the Admin UI relation views).

required: boolean
system: boolean
type: string
unique: boolean

Deprecated: This field is no-op and will be removed in future versions. Please use the collection.Indexes field to define a unique constraint.

Generated using TypeDoc