Skip to main content

Field metadata

Each field can receive additional information under cms, which is evaluated by the CMS database and the editing application.

interface IMetaData {
cms?: {
/** With sortable: preferred sort direction, ascending by default. */
ascending?: boolean
/** Show the field in the list of the editing application. */
column?: boolean
/** Display name of the field. */
label?: string
/** Include the field in the full-text search. */
fulltext?: boolean
/** Create a database index. */
index?: 'ascending' | 'descending'
/** Offer sorting by the field. */
sortable?: boolean
/** Create a unique database index. */
unique?: boolean
/** Index is case-sensitive, no by default. */
useCase?: boolean
}
}

Database​

  • index creates a database index (ascending or descending). Without further settings, it speeds up searching and sorting by the field.
  • unique creates an index that ensures each value of the field occurs only once. For optional fields, only one record without a value can then exist. unique and index can be combined. The check may only be possible on the server.
  • useCase only takes effect together with index or unique. Without useCase, the index compares case-insensitively: with unique, for example, inSynergie and insynergie cannot then both occur. With useCase, the comparison is exact.
  • fulltext additionally creates a MongoDB text index, which allows a search with $text. The editing application currently does not use it.

Editing application​

  • label: display name of the field. If not specified, the technical name is used.
  • column: The field also appears in the list of records, not just in the form. For subfields of a substructure, column must also be set on the substructure. Some data types can never be displayed as a column, e.g. HTML content.
  • sortable: The list offers sorting by the field. Here too: not for all data types, e.g. not for files. The allowed sort fields in queries are also determined by sortable.
  • ascending: For sortable fields, the preferred direction of the first sort, ascending by default. Descending makes sense for time-like values. There is no dedicated data type for points in time, but a string in ISO 8601 format sorts correctly if you restrict yourself to one time zone (recommended: UTC).

The fields appear in the form in the order of the description.