Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Treatment insert

json/value::insert


Parameters

↳ var key: string

Inputs

⇥ object: Stream<Json> (json::Json)
⇥ value: Stream<Json> (json::Json)

Outputs

↦ json: Stream<Json> (json::Json)


Emit each JSON object of object with key set to the value of value coming with it, replacing the value it had.

Values that are not JSON objects are emitted unchanged.

graph LR
     T("insert(key=\"name\")")
     A["{} … {name: 🟨}"] -->|object| T
     V["🟦 … 🟦"] -->|value| T
     T -->|json| B["{name: 🟦} … {name: 🟦}"]

     style A fill:#ffffff,stroke:#ffffff
     style V fill:#ffffff,stroke:#ffffff
     style B fill:#ffffff,stroke:#ffffff