put-absent-path
record →
put-absent-path(
path: expression,
value: expression
) → record
Assigns the field at a dynamic path only when the final segment is absent, creating missing intermediate records.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
path | expression | Yes | An expression producing non-empty text for one literal segment or a non-empty tuple of non-empty text segments. |
value | expression | Yes | The expression producing the assigned value from the original input record. |
Argument evaluation
path: Evaluated once against the value entering this call.value: Evaluated against the original incoming record only if the target path is absent.
Examples
{name := "Alice"} | put-absent-path(T("details", "age"), 42) → {name := "Alice", details := {age := 42}}
Kind: Function
Scope: record
Aliases: None