Index
Edit

Document

Everything in the content studio starts with the document. A document is what you create and edit in the studio—all the other types you may define live inside the documents. In the default studio configuration, the document-types are the ones that will be listed in the content-column.

Properties

typestring

Required. Value must be set to document.

orderingsarray

A declaration of possible ways to order documents of this type. Documented here.

fieldsarray

The fields of this object. At least one field is required. Documented here.

fieldsetsarray

A list of fieldsets that fields may belong to. Documented here.

previewobject

Use this to implement an override for the default preview for this type. Documentation here.

titlestring

Human readable label for the field.

namestring

Required. The field name. This will be the key in the data record.

hiddenboolean

If set to true, this field will be hidden in the Content Studio.

readOnlyboolean

If set to true, this field will not be editable in the content studio.

descriptionstring

Short description to editors how the field is to be used.

At its core, a document is a JSON-object that has a unique _id, timestamps (_createdAt_updatedAt) and revision-marker _rev.

The document type is used to define the structure of a document that can be stored in our data store. You can think of a document as an object that, in addition to the fields you define, also has a unique id, (_id), a field for tracking created time and last updated time (_createdAt and _updatedAt) and a revision marker (_rev). Only documents can be referred to from other documents or retrieved by id and only document types will listed and creatable in the studio.

Apart from the above, documents are defined just like regular objects, so see the documentation of the object type for more info about how to define documents.

Schema
{
  title: 'Movie',
  name: 'movie',
  type: 'document',
  fields: [
    {
      title: 'Title',
      name: 'title',
      type: 'string'
    },
    {
      title: 'Poster',
      name: 'poster',
      type: 'image'
    },
    {
      title: 'Directors',
      name: 'directors',
      type: 'array',
      of: [{type: 'string'}]
    }
  ]
}
JSON output
{
  "_type": "movie",
  "_id": "2106a34f-315f-44bc-929b-bf8e9a3eba0d",
  // ... _createdAt, _updatedAt, _rev omitted
  "title": "Alien",
  "poster": {... <an image object> ...},
  "directors": ["Ridley Scott"]
}

Previous: Schema TypesNext: Object