Array to Map
(.[] | select(. != null) ) as $i ireduce({}; .[$i | key] = $i)Simple example
cool:
- null
- null
- helloyq '.cool |= array_to_map' sample.ymlcool:
2: helloLast updated
(.[] | select(. != null) ) as $i ireduce({}; .[$i | key] = $i)cool:
- null
- null
- helloyq '.cool |= array_to_map' sample.ymlcool:
2: helloLast updated