zhanjingbaobao

zhanjingbaobao

Merging two lists of maps

I currently have two list data.

data1 = [%{id: "111", name: "name1"},
           %{id: "222", name: "name2"},
           %{id: "333", name: "name3"},
           %{id: "444", name: "name4"}
          ]

data2 = [
  %{
    mapData: %{
      "111": "data1.com",
      "222": "data2.com",
      "333": "data3.com",
    }
  },
  %{
      mapData: %{
        "111": "data11.com",
        "222": "data22.com",
      },
      mapData: %{
        "111": "data111.com"
      }

  }
]

Now I want to obtain data in this format.

 [
           %{id: "111", name: "name1",address:"data1.com"},
           %{id: "111", name: "name1",address:"data11.com"},
           %{id: "111", name: "name1",address:"data111.com"},
           %{id: "222", name: "name2",address:"data2.com"},
           %{id: "222", name: "name22",address:"data22.com"},
           %{id: "333", name: "name3",address:"data3com"},
           %{id: "444", name: "name4",address:""}
          ]

I don’t know how to implement it now.I am a beginner and I hope everyone can help me. Thank you.

First 10 of 12 Posts! Switch mode

cloudytoday

cloudytoday

Could you please post the sample data exactly the way you have it? From this example it’s not clear why in data2 the keys are quoted atoms ("111": ...) and not usual string keys ("111" => ...) and whether this is intentional.

Regardless, you could look for something like this:

iex(39)> for %{id: id, name: name} <- data1,
             %{mapData: m2} <- data2,
             is_map_key(m2, String.to_atom(id)),
             do: %{id: id, name: name, address: m2[String.to_atom(id)]} 
[
  %{address: "data1.com", id: "111", name: "name1"},
  %{address: "data111.com", id: "111", name: "name1"},
  %{address: "data2.com", id: "222", name: "name2"},
  %{address: "data3.com", id: "333", name: "name3"}
]
dimitarvp

dimitarvp

It will help if you give little more context about what exactly do you want to achieve. That way people can give you better solutions.

cloudytoday

cloudytoday

So you want to match everything from data1 with the name field from data2, but how exactly? They don’t seem to have anything in common, so nothing to refer to. Or do you want to just match them by the order in the lists?

Eiji

Eiji

Copying these over from the Elixir chat room.

[chat quote=“zhanjingbaobao;869;2023-04-10T07:37:20Z” channel=“Elixir Chat” channelId=“2” multiQuote=“true” chained=“true”]
I currently have two list data.

data1 = [
  %{id: "111", name: "name1"},
  %{id: "222", name: "name2"},
  %{id: "333", name: "name3"},
  %{id: "444", name: "name4"}
]

data2 = [
  %{
    mapData: %{
      "111": "data1",
      "222": "data2_test",
      "333": "data3_test"
    }
  },
  %{
    mapData: %{
      "111": "data11_test",
      "222": "data22_test"
    },
    mapData: %{
      "111": "data111_test"
    }
  }
]

# Now I want to obtain data in this format.
mergeData = [
  %{id: "111", name: "name1", address: "data1_test"},
  %{id: "111", name: "name1", address: "data11_test"},
  %{id: "111", name: "name1", address: "data111_test"},
  %{id: "222", name: "name2", address: "data2_test"},
  %{id: "222", name: "name22", address: "data22_test"},
  %{id: "333", name: "name3", address: "data3_test"},
  %{id: "444", name: "name4", address: ""}
]

I don’t know how to implement it now.I am a beginner and I hope everyone can help me. Thank you.
[/chat]

[chat quote=“Eiji;871;2023-04-10T10:02:12Z” chained=“true”]
Your data2 map is invalid as it’s keys are not unique and therefore only last would be used.

There are 2 other issues … In data2 the first 111 have data1 address, but should have data1_test. In mergeData you have name22 instead of name2.

After applying all fixed this is a final example code:

defmodule Example do
  def sample(data, addresses) when is_list(data) and is_list(addresses) do
    # a list of addressess
    flat_addresses =
      addresses
      # reduce it with an empty list
      |> Enum.reduce([], fn %{mapData: addresses}, acc ->
        # take a map value under mapData key
        addresses
        # change atom id to string
        |> Enum.map(fn {id, address} -> {Atom.to_string(id), address} end)
        # concat the result with acc
        |> then(&(acc ++ &1))
      end)
      # the original addresses are sorted partially i.e. only in specified mapData
      # to fix that we simply need to sort the flat list result by id
      |> Enum.sort_by(&elem(&1, 0))

    # in order to recursively pattern match key by key we need to change a list of maps
    # to a map with id as key and name as value
    data |> Enum.map(&{&1.id, &1.name}) |> merge(flat_addresses)
  end

  # function head is required when using a default argument(s)
  # in functions with multiple clasule
  defp merge(data, addresses, last_matched \\ false)

  # when done simply finish a recursive call returning an empty list as result tail
  defp merge([], [], _last_matched), do: []

  # if id matches add a new map to result and continue with same data and the rest of addresses
  defp merge([{id, name} | _data_tail] = data, [{id, address} | addresses], _last_matched) do
    [%{address: address, id: id, name: name} | merge(data, addresses, true)]
  end

  # if id does not match and previous clause matched for this id
  # we simply continue with rest of data and same addresses
  defp merge([_data_head | data], addresses, true), do: merge(data, addresses, false)

  # otherwise if id still does not match and previous clause do not matched for this id even once
  # add a new map with an empty address and continue with rest of data and same addresses
  # the combination of last_matched boolean argument and this clause
  # is required in case we do not have any addresses for specific data like it is for "444" id 
  defp merge([{id, name} | data], addresses, false) do
    [%{address: "", id: id, name: name} | merge(data, addresses, false)]
  end
end

data = [
  %{id: "111", name: "name1"},
  %{id: "222", name: "name2"},
  %{id: "333", name: "name3"},
  %{id: "444", name: "name4"}
]

addresses = [
  %{
    mapData: %{
      # fix: "data1" -> "data1_test"
      "111": "data1_test",
      "222": "data2_test",
      "333": "data3_test"
    }
  },
  # fix: split map wih duplicate keys into two separate maps
  %{
    mapData: %{
      "111": "data11_test",
      "222": "data22_test"
    }
  },
  %{
    mapData: %{
      "111": "data111_test"
    }
  }
]

expected = [
  %{id: "111", name: "name1", address: "data1_test"},
  %{id: "111", name: "name1", address: "data11_test"},
  %{id: "111", name: "name1", address: "data111_test"},
  %{id: "222", name: "name2", address: "data2_test"},
  # fix: "name22" -> "name2"
  %{id: "222", name: "name2", address: "data22_test"},
  %{id: "333", name: "name3", address: "data3_test"},
  %{id: "444", name: "name4", address: ""}
]

iex> Example.sample(data, addresses) == expected
true

[/chat]

[chat quote=“zhanjingbaobao;880;2023-04-11T07:33:27Z” chained=“true”]
Thank you very much Eiji,but when I tested the code, I didn’t get the data structure I expected.

I have two pieces of data: data1 and data2,

data1 = [
  %{
    channelId: "1",
    describtion: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "2",
    describtion: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "3",
    describtion: "dev-test_003",
    tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "4",
    describtion: "dev-test_004",
    tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"}
  }
]

data2 = [
  %{
    mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta", "3": "channel3_dadta"},
    mediaTailorRegion: "us-east-1",
    name: "testName1"
  },
  %{
    mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta"},
    mediaTailorRegion: "us-east-2",
    name: "testName2"
  },
  %{mediaTailoId: %{"1": "channel1_data"}, mediaTailorRegion: "us-east-3", name: "testName3"}
]

Here are my expected data.Expected results do not need to be sorted, as long as the content can be aligned.

expect_data = [
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName1"
  },
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName2"
  },
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName3"
  },
  %{
    channelId: "2",
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"},
    name: "testName1"
  },
  %{
    channelId: "2",
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"},
    name: "testName2"
  },
  %{
    channelId: "3",
    describtion: "dev-test_003",
    tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"},
    name: "testName2"
  },
  %{
    channelId: "4",
    describtion: "dev-test_004",
    tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"},
    name: ""
  }
]

Thank you for reading this message.

[/chat]

[chat quote=“Eiji;882;2023-04-11T08:59:52Z” chained=“true”]
Again, you had issues in your data. Firstly there is descri**b**tion instead of descri**p**tion. Secondly 2nd last expected map should have name testName1 instead of testName2.

Here goes the complete example with fixed data:

defmodule Example do
  def sample(data, names) when is_list(data) and is_list(names) do
    # a list of names
    # reduce it with an empty list
    flat_names =
      Enum.reduce(names, [], fn %{mediaTailoId: ids_map, name: name}, acc ->
        # take a map value under mapData key
        ids_map
        # change atom id to string
        |> Enum.map(fn {id, _value} -> {Atom.to_string(id), name} end)
        # concat the result with acc
        |> then(&(acc ++ &1))
      end)
      # the original names are sorted partially i.e. only in specified mediaTailoId
      # to fix that we simply need to sort the flat list result by id
      |> Enum.sort_by(&elem(&1, 0))

    # in order to recursively pattern match key by key we need to change a list of maps
    # to a map with id as key and name as value
    data |> Enum.map(&{&1.channelId, &1}) |> merge(flat_names)
  end

  # function head is required when using a default argument(s)
  # in functions with multiple clasule
  defp merge(data, names, last_matched \\ false)

  # when done simply finish a recursive call returning an empty list as result tail
  defp merge([], [], _last_matched), do: []

  # if id matches add a new map to result and continue with same data and the rest of names
  defp merge([{id, map} | _data_tail] = data, [{id, name} | names], _last_matched) do
    [Map.merge(map, %{name: name}) | merge(data, names, true)]
  end

  # if id does not match and previous clause matched for this id
  # we simply continue with rest of data and same names
  defp merge([_data_head | data], names, true), do: merge(data, names, false)

  # otherwise if id still does not match and previous clause do not matched for this id even once
  # add a new map with an empty name and continue with rest of data and same names
  # the combination of last_matched boolean argument and this clause
  # is required in case we do not have any names for specific data like it is for "444" id 
  defp merge([{_id, map} | data], names, false) do
    [Map.merge(map, %{name: ""}) | merge(data, names, false)]
  end
end

data1 = [
  %{
    channelId: "1",
    # fix: describtion -> description
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "2",
    # fix: describtion -> description
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "3",
    # fix: describtion -> description
    description: "dev-test_003",
    tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "4",
    # fix: describtion -> description
    description: "dev-test_004",
    tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"}
  }
]

data2 = [
  %{
    mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta", "3": "channel3_dadta"},
    mediaTailorRegion: "us-east-1",
    name: "testName1"
  },
  %{
    mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta"},
    mediaTailorRegion: "us-east-2",
    name: "testName2"
  },
  %{mediaTailoId: %{"1": "channel1_data"}, mediaTailorRegion: "us-east-3", name: "testName3"}
]

expect_data = [
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName1"
  },
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName2"
  },
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName3"
  },
  %{
    channelId: "2",
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"},
    name: "testName1"
  },
  %{
    channelId: "2",
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"},
    name: "testName2"
  },
  %{
    channelId: "3",
    description: "dev-test_003",
    tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"},
    # fix: "testName2" -> "testName1" 
    name: "testName1"
  },
  %{
    channelId: "4",
    description: "dev-test_004",
    tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"},
    name: ""
  }
]

iex> Example.sample(data1, data2) == expect_data
true

@AstonJ Could you please move our messages to a separate topic, please?
[/chat]

Note: Fixed code formatting.

adamu

adamu

Reminds me of this How to merge two list with maps based on particular key

And the person on SO asking the same thing. Just has mapData instead of price.

zhanjingbaobao

zhanjingbaobao

When I verified the code, I found that true could not be printed out, and the print result:

%{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "2",
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "3",
    description: "dev-test_003",
    tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "4",
    description: "dev-test_004",
    tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"}
  }
]
false
zhanjingbaobao

zhanjingbaobao

I use the channelID of data1 to match any key of mediaTailoId in data2. If the match is successful, data1 will add a new piece of data. The data of id=1 in data1 appears three times in data2, so there are three id=1 in the final result I generated, and the name of each is the name of data2. id=4 does not have any matching records in data2, so name=“”.My code,but it doeson’t work.

    data1 = [
      %{channelId: "1", describtion: "dev-test_001", tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"}},
      %{channelId: "2", describtion: "dev-test_002", tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"}},
      %{channelId: "3", describtion: "dev-test_003", tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"}},
      %{channelId: "4", describtion: "dev-test_004", tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"}}
    ]

    data2 = [
      %{mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta", "3": "channel3_dadta"}, mediaTailorRegion: "us-east-1", name: "testName1"},
      %{mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta"}, mediaTailorRegion: "us-east-2", name: "testName2"},
      %{mediaTailoId: %{"1": "channel1_data"}, mediaTailorRegion: "us-east-3", name: "testName3"}
    ]
 result1 = Enum.flat_map(data1, fn channel ->
      Enum.map(data2, fn media ->
        IO.inspect(media.mediaTailoId)
        IO.inspect(channel.channelId)
        IO.inspect(Map.get(media.mediaTailoId, :"#{channel.channelId}"))
        if Map.get(media.mediaTailoId, channel.channelId) != nil do
          %{channel | name: media.name}
        else
          %{channel | name: ""}
        end
      end)
    end)
     IO.inspect(result1)
Eiji

Eiji

No idea how you got those results. Which code example have you used? Since you give 2 different inputs and expected I wrote two examples. Maybe you have used the wrong one?

zhanjingbaobao

zhanjingbaobao

If there is a piece of data in data2 that does not match the channelId of data1, there will be an exception. I tried to judge but failed.
For example:

data2 = [
  %{
    mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta", "3": "channel3_dadta"},
    mediaTailorRegion: "us-east-1",
    name: "testName1"
  },
  %{
    mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta"},
    mediaTailorRegion: "us-east-2",
    name: "testName2"
  },
  %{mediaTailoId: %{"1": "channel1_data"}, mediaTailorRegion: "us-east-3", name: "testName3"},
  %{mediaTailoId: %{"666": "channel1_data"}, mediaTailorRegion: "us-east-3", name: "testName666"}
]

data1 has not changed,I think the problem should be here, but I failed to modify it successfully, I am very sorry to ask you for help again.

[Map.merge(map, %{name: ""}) | merge(data, names, false)]
Eiji

Eiji

Yes, as this was not mentioned originally.

No worries.

No, it’s not. As above you have added a special cases not mentioned before. Here is the current error:

** (FunctionClauseError) no function clause matching in Example.merge/3    
    
    The following arguments were given to Example.merge/3:
    
        # 1
        []
    
        # 2
        [{"666", "testName666"}]
    
        # 3
        false

We can see that we have done with data, but still have extra names list elements. This means that we only need to modify a strict condition that finishes our recursive process i.e.

# in case no extra names we can strictly pattern match here
defp merge([], [], _last_matched), do: []
# in case we do not care about more items in `names` list
defp merge([], _names, _last_matched), do: []

Also I have simplified my example a bit:

defmodule Example do
  def sample(data, names) when is_list(data) and is_list(names) do
    # a list of names
    # reduce it with an empty list
    names
    |> Enum.reduce([], fn %{mediaTailoId: ids_map, name: name}, acc ->
      # take a map value under mapData key
      ids_map
      # change atom id to string
      |> Enum.map(fn {id, _value} -> {Atom.to_string(id), name} end)
      # concat the result with acc
      |> then(&(acc ++ &1))
    end)
    # the original names are sorted partially i.e. only in specified mediaTailoId
    # to fix that we simply need to sort the flat list result by id
    |> Enum.sort_by(&elem(&1, 0))
    |> then(&merge(data, &1))
  end

  # function head is required when using a default argument(s)
  # in functions with multiple clasule
  defp merge(data, names, last_matched \\ false)

  # when done simply finish a recursive call returning an empty list as result tail
  defp merge([], _names, _last_matched), do: []

  # if id matches add a new map to result and continue with same data and the rest of names
  defp merge([%{channelId: id} = map | _data_tail] = data, [{id, name} | names], _last_matched) do
    [Map.merge(map, %{name: name}) | merge(data, names, true)]
  end

  # if id does not match and previous clause matched for this id
  # we simply continue with rest of data and same names
  defp merge([_data_head | data], names, true), do: merge(data, names, false)

  # otherwise if id still does not match and previous clause do not matched for this id even once
  # add a new map with an empty name and continue with rest of data and same names
  # the combination of last_matched boolean argument and this clause
  # is required in case we do not have any names for specific data like it is for "444" id 
  defp merge([map | data], names, false) do
    [Map.merge(map, %{name: ""}) | merge(data, names, false)]
  end
end

data1 = [
  %{
    channelId: "1",
    # fix: describtion -> description
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "2",
    # fix: describtion -> description
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "3",
    # fix: describtion -> description
    description: "dev-test_003",
    tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"}
  },
  %{
    channelId: "4",
    # fix: describtion -> description
    description: "dev-test_004",
    tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"}
  }
]

data2 = [
  %{
    mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta", "3": "channel3_dadta"},
    mediaTailorRegion: "us-east-1",
    name: "testName1"
  },
  %{
    mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta"},
    mediaTailorRegion: "us-east-2",
    name: "testName2"
  },
  %{mediaTailoId: %{"1": "channel1_data"}, mediaTailorRegion: "us-east-3", name: "testName3"},
  %{mediaTailoId: %{"666": "channel1_data"}, mediaTailorRegion: "us-east-3", name: "testName666"}
]

expect_data = [
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName1"
  },
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName2"
  },
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName3"
  },
  %{
    channelId: "2",
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"},
    name: "testName1"
  },
  %{
    channelId: "2",
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"},
    name: "testName2"
  },
  %{
    channelId: "3",
    description: "dev-test_003",
    tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"},
    # fix: "testName2" -> "testName1" 
    name: "testName1"
  },
  %{
    channelId: "4",
    description: "dev-test_004",
    tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"},
    name: ""
  }
]

iex> Example.sample(data1, data2) == expect_data
true

Last Post!

zhanjingbaobao

zhanjingbaobao

sorry,this is the new data

data1 = [
      %{channelId: "1", describtion: "dev-test_001", tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"}},
      %{channelId: "2", describtion: "dev-test_002", tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"}},
      %{channelId: "3", describtion: "dev-test_003", tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"}},
      %{channelId: "4", describtion: "dev-test_004", tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"}}
    ]

    data2 = [
      %{mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta", "3": "channel3_dadta"}, mediaTailorRegion: "us-east-1", name: "testName1"},
      %{mediaTailoId: %{"1": "channel1_data", "2": "channel2_dadta"}, mediaTailorRegion: "us-east-2", name: "testName2"},
      %{mediaTailoId: %{"1": "channel1_data"}, mediaTailorRegion: "us-east-3", name: "testName3"}
    ]

On this basis I also want to get the name attribute in data2 as another attribute of data1. I tried without success. Do you have any good suggestions?
my expect_data

expect_data = [
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName1"
  },
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName2"
  },
  %{
    channelId: "1",
    description: "dev-test_001",
    tags: %{pipelineId: "1001", pipelineTemplate: "live-drm"},
    name: "testName3"
  },
  %{
    channelId: "2",
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"},
    name: "testName1"
  },
  %{
    channelId: "2",
    description: "dev-test_002",
    tags: %{pipelineId: "1002", pipelineTemplate: "live-drm"},
    name: "testName2"
  },
  %{
    channelId: "3",
    description: "dev-test_003",
    tags: %{pipelineId: "1003", pipelineTemplate: "live-drm"},
    # fix: "testName2" -> "testName1" 
    name: "testName1"
  },
  %{
    channelId: "4",
    description: "dev-test_004",
    tags: %{pipelineId: "1004", pipelineTemplate: "live-drm"},
    name: ""
  }
]

Where Next?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement