根据索引合并clojure中的两个映射向量

Merge two vectors of maps in clojure based on index

我在 clojure 中有两个映射向量,我希望将它们合并为一个映射向量,但每个索引处的映射都已合并。我只是想知道最好的方法。

例如:

[{:sku "e1" :name "example1"} {:sku "e2" :name "example2"}]
[{:color "Blue" :price 9.99} {:color "Red" :price 15.99}]

将合并到:

[{:sku "e1" :name "example1" :color "Blue" :price 9.99} {:sku "e2" :name "example2" :color "Red" :price 15.99}]

使用mapv and merge:

(mapv merge 
      [{:sku "e1" :name "example1"} {:sku "e2" :name "example2"}]
      [{:color "Blue" :price 9.99} {:color "Red" :price 15.99}])

=> [{:sku "e1", :name "example1", :color "Blue", :price 9.99} {:sku "e2", :name "example2", :color "Red", :price 15.99}]