Models and fields
A model is the shape of one kind of record, such as a page or a product. You compose it from sixteen built-in field types, and a model that holds records gets its own typed queries and mutations in your API.
Sixteen field types
Plain text is one type and rich text is another, called prose. Numbers are two types as well: integer for whole numbers and decimal for exact ones. The others are boolean, date, JSON, list, reference and geopoint, three for files and media (file, image and video), two kinds of choice, and a field that stores a model's key.
An enum is a fixed list of options written on the field. A select takes its options from the records of another model. Either can allow several choices. A geopoint is indexed when you declare it, so records can be found by distance.
Integers and decimals
An integer beyond ±2^53 is refused. A decimal travels as a string and keeps its scale, so 19.90 stays 19.90, and a JSON number sent to a decimal field is refused. The SDK hands a decimal to your code as its own exact type, so a price never passes through floating point.
What every field takes
A field has a key, a label, help text, a default value, a required flag and an access policy naming who may read and write it. Mark a field queryable and it is indexed for filtering and sorting. The index is rebuilt over existing records when the change is published.
Record models and inline models
A model either holds records or is inline. An inline model has no records of its own, and its key becomes a field type you can use in other models.
Console or code
Define a model in the console, with a CLI command, or in code in your project's config file, which the CLI pushes. Editing a model's fields creates a new schema version, and earlier versions can be restored.
Read the detail
The field types reference lists every type with its options and the shape it returns on a read.