lb_link_nodes
Creates typed edges from one source node to one or more target nodes. The write is a replace operation per link_type: all existing edges of that type from the source node are replaced with the new target set.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| source_node_id | string | Yes | ID of the source node (the edges originate here) |
| target_node_ids | string[] | Yes | IDs of target nodes. Must contain 1–16 entries |
| link_type | string | No | One of related, next, derived_from, supersedes, mentions, invokes. Default related |
Response
Section titled “Response”{ "source_node_id": "...", "link_type": "related", "targets_set": 2}Errors
Section titled “Errors”| Code | When |
|------|------|
| NOT_FOUND | source_node_id does not exist, or one or more targets do not exist in the current tenant |
Usage notes
Section titled “Usage notes”- Replace semantics: calling
lb_link_nodes(A, [B, C], "related")thenlb_link_nodes(A, [D], "related")leaves A with only a singlerelatededge to D. Otherlink_typevalues from A are untouched. target_node_idsis capped at 16 to stay under D1's parameter-bind limit.- Edge writes are atomic: the DELETE of old edges and INSERT of new edges run in one
db.batch()call. - To append rather than replace, read the current edges via
lb_get_related, merge client-side, then calllb_link_nodeswith the merged set.