Property Access
The Medable API affords developers the ability to access and update property data in flexible and convenient ways.
Although Property Selection can reduce the number of paths returned while maintaining the structure of the document. One way to do it
A single property can also be directly accessed, resulting in a result response.
Even Simpler
A property within a document array can be directly accessed, using its _id
("551f34c8b8b206e835950b57"
). For example, retrieving the name of a custom role:
Properties may be updated in the same way. The following are both valid ways to update the name of the above role:
The above response includes the entire updated context.
Property and Document arrays can be configured to allow overwrite, append-only, and/or pull. Arrays can also be configured to ensure unique values within the array, or in the case of a Document array, a property can have a validator that ensures it is unique within the rest of the parent array's documents.
Appending items to an array using the API must be done using the
POST
method.Overwriting an array is done using
PUT
.Array elements can be directly access by index (
GET /orgs/5516ee1b34d8d934281699e3/roles/0
).Array elements cannot be updated by index.
When removing elements from a document array, use the
_id
(DELETE /orgs/5516ee1b34d8d934281699e3/roles/551f34c8b8b206e835950b57
)When removing elements from a primitive array, all matching values are removed (
DELETE /c_custom/c_tags/MyTag
)
Last updated