manage_relationship_type

Manage relationship types. A relationship type must exist before any relationship of that type can be created — it optionally validates the relationship's metadata against a JSON Schema and restricts which collections it may connect. Actions: upsert, get, list, delete.

Parameters

NameTypeRequiredDescription
actionenum: upsert | get | list | deleteYes
database_idstringYesTarget database ID
rel_typestringNoThe relationship type id (rel_type). Required for upsert, get, delete
descriptionstringNo
data_schemaobjectNoJSON Schema validating the relationship's data. Omit or null to allow any data.
source_collectionsarrayNoAllowed source collections. Empty/omitted means any collection.
target_collectionsarrayNoAllowed target collections. Empty/omitted means any collection.