yq/pkg/yqlib/doc/operators/headers/array-to-map.md
2022-11-08 13:40:00 +11:00

215 B

Array to Map

Use this operator to convert an array to..a map. Skips over null values.

Behind the scenes, this is implemented using reduce:

(.[] | select(. != null) ) as $i ireduce({}; .[$i | key] = $i)