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.
| 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 |
| Code | When |
|---|
NOT_FOUND | source_node_id does not exist, or one or more targets do not exist in the current tenant |
- Replace semantics: calling
lb_link_nodes(A, [B, C], "related") then lb_link_nodes(A, [D], "related") leaves A with only a single related edge to D. Other link_type values from A are untouched.
target_node_ids is 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 call lb_link_nodes with the merged set.