Flexible Schema
A document "schema" is the description of what fields are in the document, what type of data makes up each of the document's fields, and how each document links to other documents.
Mostly it's just designing forms, kind of hard to make it exciting. Just please don't over-engineer it, or the next thing you know you're the DMV.
Documents
A document is a single form with multiple fields. On our crowd-sourced internet database for turntables, Wiki-Wiki-Wikipedia, we have a document called "About" where we have fields for our Manifesto, Terms of Use, and a list of reference to our founding member's bios.
Each document requires you give it a name, and a list of fields.
You can also give a document a custom icon (just for fun) and a description that will appear in the sidebar when a contributor opens the document. Use the description to tell contributors what you're looking for in each field, where the document will be used, or just to tell jokes.
Collections
Collections are lists of documents. The schema is the same as for a single document, but applies to every document in the collection.
When you open a collection, you'll see a list of document. You can use the drag handles to sort this list, or specify an order when you query the collection using the REST API.
Fields
Documents store their content in fields. Add, remove, update, and sort fields in the document's schema.
Each field has a name to identify it, a hint that's shown under the input for on the form, and settings for:
Required Fields
The Required setting flags a field as required for contributors, and also stops documents from being published unless all required fields are filled.
Lists
The Allow Multiple setting changes the field from a single field into a list that contributors can add values to, remove values from, and sort.
Types
Text
Use text fields for everything from short snippets to full articles.
- Rich Text changes the field from a single line to a multi-line rich text input.
Date
A simple date field.
File
A file upload field.
- File Type limit possible uploads to images or videos, or don't specify to allow any type of file.
Switch
A simple on/off switch.
Select
Select from a fixed set of options.
- Options
Reference
Reference a document in another collection.
- Collection defines which collection.
Code
A formatted code input.
Sub Fields
When you turn on Allow Multiple, you can often add "sub-fields". These fields are the same as document fields, but are added to each item in their parent field.
You can use sub-fields for describing relationships, or for things like captions on a list of images.