Studio

Global Document Reference

Schema type reference documentation for Global Document References.

Global document references (GDR) expand the concept of the reference type to support referencing documents in other datasets. See the GlobalDocumentReferenceDefinition reference for the full type definition.

Global document references are limited to Media Library

Like standard references, global document references can be either strong (default) or weak. A strong reference will ensure that the document it points to actually exists and will not allow the deletion of a document that any other document refers to. A weak reference allows pointing to documents that may not exist (yet) or have been deleted.

Properties

  • Requiredtype

    string

    Value must be set to globalDocumentReference.

  • Requiredname

    string

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

  • RequiredresourceType

    string

    The resource type containing the connected documents. At the moment, Media Library can reference the dataset resource type.

  • RequiredresourceId

    string

    The ID of the target resource. A resourceId is made up of the projectId and the dataset name, connected by a .. For example:

    • projectId.datasetName.
    • w3dbef.production
    • wm2efj.staging
  • Requiredto

    array

    Must contain an array naming all the types which may be referenced. For example: [{type: 'person'}]. See more examples below.

  • weak

    boolean

    If set to true the reference will be made weak. This allows references to point at documents that may or may not exist, such as a document that has not yet been published or a document that has been deleted (or indeed an entirely imagined document).

  • title

    string

    Human-readable label for the field.

  • options

    object

    Further configure the schema type. See details in the "options" section below.

Options

  • filter

    string

    A GROQ filter string (the contents between the square brackets), such as language == "en-US".

  • Object of parameters for the GROQ-filter specified in filter.

Example

This example defines a GDR as a media library aspect. The document example shows a simplified sanity.asset document from Media Library containing this GDR aspect.

For more details on creating aspects that use GDRs and querying ML assets, see the Media Library documentation.

Was this page helpful?