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
indexcreates a database index (ascendingordescending). Without further settings, it speeds up searching and sorting by the field.uniquecreates an index that ensures each value of the field occurs only once. For optional fields, only one record without a value can then exist.uniqueandindexcan be combined. The check may only be possible on the server.useCaseonly takes effect together withindexorunique. WithoutuseCase, the index compares case-insensitively: withunique, for example,inSynergieandinsynergiecannot then both occur. WithuseCase, the comparison is exact.fulltextadditionally 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,columnmust 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 bysortable.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.