LL
Size: a a a
LL
AR
AB
LL
use-case
для beam
языковAR
AR
AR
AR
AR
LL
LL
(->>
{:items [{:id 2 :count 2}
{:id 1 :count 3}
{:id 1 :count 4}]}
(sp/transform [:items (sp/filterer #(= 1 (:id %))) sp/FIRST :count] inc))
{:items [{:id 2, :count 2} {:id 1, :count 4} {:id 1, :count 4}]}
original
|> Map.update!(:items, fn items ->
Enum.map(items, fn
%{id: 1, count: x} = rec -> %{rec | count: x + 1}
other -> other
end)
end)
AB
original
|> Map.update!(:items, fn items ->
Enum.map(items, fn
%{id: 1, count: x} = rec -> %{rec | count: x + 1}
other -> other
end)
end)
LL
id
AR
original
|> Map.update!(:items, fn items ->
Enum.map(items, fn
%{id: 1, count: x} = rec -> %{rec | count: x + 1}
other -> other
end)
end)
AR
AR
AR
LL
LL
LL