ä¸ç¬ããããªãã¦ãã°ã¼ã°ã«ãªã©ã§æ¤ç´¢ãããã©ããããããªãã£ããã®ã®ãããã¥ã¡ã³ããèªã¿ç´ããã解ããã
ããã¯ããã¤ãã©ã¤ã³ãç解ãã¦ãªãã¨æãã¤ããªãã¨æãã
次ã®ãããªãªãã¸ã§ã¯ããããã names
㨠scores
ã¯åãé·ãã®é
åã㤠names
ã¯éè¤ã®ãªãé
åã¨ãã¦ããããããã¼ã¸ã㦠(name, score)
ãçµã¿ã«ãããªãã¸ã§ã¯ããä½ãã®ãç®æ¨ã¨ããã
item: names: - foo - bar - baz scores: - 10 - 20 - 30
names
㨠scores
ã«ååãä»ãã¦åç
§å¯è½ã«ãã¦ããã¦ã names
ãã¡ã¤ã³ã®ã¤ãã¬ã¼ã¿ã¼ã¨ãã¦ã¤ã³ããã¯ã¹ãèªèº«ããåå¾ãã¦ããã®ã¤ã³ããã¯ã¹ã§ scores
ãã score
ãåå¾ãã
.item.names as $names | .item.scores as $scores | [ .item.names[] | . as $name | { name: ., score: $scores[ $names | index($name) ] } ]