Index
Edit

Reference

Relations between documents are modeled using the reference type. To model a one-to-many relation, you can store the references in an array.

Example: define the movie's director as a reference to a person:

{
  name: 'movie',
  type: 'object',
  fields: [
    {
      title: 'Director',
      name: 'director',
type: 'reference',
to: [{type: 'person'}]
} } ]

Example output

{
  "_type": "reference",
  "_ref": "ffda9bed-b959-4100-abeb-9f1e241e9445" /* This could be the id of Jessica Chastain */
}

Example: The directors field is an array which can contain both person and bovine references:

Example output

[
  {
    "_type": "reference",
    "_ref": "9b711031-3744-47ab-9bb7-1bceb177d0d0" /* this could be the id of a Bovine document */
  },
  {
    "_type": "reference",
    "_ref": "ffda9bed-b959-4100-abeb-9f1e241e9445" /* this could be the id of Matt Damon */
  }
]

Previous: DateNext: Geopoint