foreachmap

SpecialNodes foreachmap

input ports:
Name Type Description Optional

input

map<?0>to<?1>

map to be iterated. must be non-empty.

no

output ports:
Name Type Description Optional

key

?0

a key of the map

yes

val

?1

value associated with current key in the map

yes

final

bool

true if key is the last key of the map

yes

foreachmap reads its input port without removing the value it reads. The value it reads is a map, which must be non-empty. It is an error if an empty map is read. For every key / value pair of the input map except the last, that pair is output from the key and val ports, and false is output on the final port. The last key / value pair of the map is then output from the key and val ports, true is output on the final port, and the input map is removed from the input port. It is recommended that you read the Iteration section of the Dataflow in Coreograph document in addition to the information presented here.