Skip to content

Collections and fields

Content in a project is organised in collections (posts, pages, products, whatever your site needs). A collection’s schema declares its fields; the schema drives the editing form in the dashboard, validation on every save, and the types GemSync generates for your code.

PrimitiveStoresNotes
stringTextValidations for length, email, URL, UUID, IP and custom rules.
numberNumbersMin/max and step validations.
booleanTrue/false
dateA timestampStored as ISO 8601.
fileAn uploaded fileUp to 5 MB per file. Filename, size and content type are stored with the document.
linkA reference to a document in another collectionThe linked document travels with API responses unless you opt out with without_links.
  • required: the document won’t save without a value. Editors see a “Required field” message on the field.
  • arrayOf: the field holds a list of values instead of one (a list of strings, files or links).
  • translatable: the field stores one value per project language. See locales and translations.

Fields can carry validation rules (length bounds, numeric ranges, formats such as email or URL). They run on every save, from the dashboard and from the API alike, and failures come back per field, so editors see exactly what to fix.

Mark one field as primary. Its value becomes the document’s label in dashboard listings and feeds the document’s search text.

Schema changes take effect immediately: the dashboard form updates and the generated types change with it. After any schema change, rerun GemSync in the codebases that consume the project so the compiler can walk you through the affected code.