update¶
Hook for updating dict objects with values, appending list values, or overwriting string / int / float values.
Inputs¶
Name | Type | Default | Required | Description |
---|---|---|---|---|
src | Union[dict, str, list] | True | A dict to update and output the result or a str with separators or list for a key path to the item update within the context. | |
input | Any | True | The value to update the input src . |
|
sep | str | / | True | For string src's, a separator for key path. |
Arguments¶
Position | Argument | Type |
---|---|---|
1 | src | Union[dict, str, list] |
2 | input | Any |
Returns¶
Optional[dict]
Examples¶
Update a map with a string and a map in place
input:
map:
stuff: things
update with string in place_>: update input/map "more things"
update with map in place_>: update input/map {'foo':'bar'}
input:
map:
stuff: more things
foo: bar
Update a map with another map in place¶
input:
map:
stuff: things
update in place_>: update input/map {'foo':'bar'}
input:
map:
stuff: things
foo: bar