Document
Property Type: document
A Document can act in two ways. When configured as an array, it is a collection of documents with shared properties. When not defined as an array, the document properties are implemented as children.
Documents whose definition is configured as an array have an _id
property which can be used to retrieve, update or remove individual documents from the array. For example, the Organization roles are defined as a document array. Retrieving the _id
of all org roles could be done as follows:
GET /orgs/5516ee1b34d8d934281699e3/roles?paths[]=_id
JSON
Notice the use of a relative path to the org roles identifiers in the query (paths[]=_id). Selection using paths, include and expand all work in this way.
An example of a non-array Document is the Account name
property, having first
and last
child properties.
GET /accounts/me
JSON
When ACLs and filters are applied at the document level, they affect access to all its children.
Discriminators
Some Document arrays contain a discriminator, such as Post and Comment bodies. Because these arrays carry documents with potentially varying properties, the name
property is used as a discriminator. When creating a Post, for example, the discriminator must be included in the json body.
POST /c_vads/551f3515b8b206e835950b59/posts/c_heartrate
JSON
When updating a document array that has a discriminator, the _id
of the segment is sufficient:
PUT /551f3a95b8b206e835950b6b
JSON
Property Options
Name
Type
Description
properties
Property Definition Array
An array of property definitions. These can be properties of any type except Document.
Base property options not available:
uniqueValues
indexed
unique
auditable
Last updated