attachRelation
Links existing records by creating directed or bidirectional relationships between source and target IDs; resolve IDs with findRecords before linking.
Instructions
Create a directed or bidirectional relationship between records. sourceId and targetId/targetIds must already exist — use findRecords to resolve records by name/attribute first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sourceId | Yes | ID of the source record | |
| targetId | No | ID of one target record (deprecated if targetIds provided) | |
| direction | No | Direction of the relationship | outgoing |
| targetIds | No | IDs of multiple target records | |
| properties | No | Optional user-defined properties to store on the relationship edge. Reserved RushDB/internal keys are rejected. | |
| relationType | No | Type of the relationship | |
| transactionId | No | Optional transaction ID for atomic relation creation |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | ||
| success | Yes |