aronteh
List of nested maps help
Hi, I have the following nested map below:
ordered_contents =[
%{
"order_id" => 1234567,
"version" => 24,
"content" => [
%{
"contents" => [
%{
"id" => "551546104",
"level" => "",
"quantity" => 340,
"random" => true,
"type" => "resource"
},
%{
"id" => "229186523",
"level" => "",
"quantity" => 15,
"random" => true,
"type" => "resource"
}
],
"id" => 2323110,
"name" => "RSS Gold",
"type" => "U",
"version" => 24
}
]
},
%{
"order_id" => 1234568,
"version" => 24,
"content" => [
%{
"contents" => [
%{
"id" => "551546104",
"level" => "",
"quantity" => 300,
"random" => true,
"type" => "resource"
},
%{
"id" => "229186523",
"level" => "",
"quantity" => 40,
"random" => true,
"type" => "resource"
}
],
"id" => 2323110,
"name" => "RSS Silver",
"type" => "U",
"version" => 24
}
]
}
]
I am new to Elixir, how do I flatten the map to read all the map value or there any shorter way?
First Post!
benwilson512
Author of Craft GraphQL APIs in Elixir with Absinthe
Welcome! When you say “read all the map values” what do you have in mind? Can you provide an example of the kind of data you’re looking to generate from that input?
0
Popular in Questions
Hi,
I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum.
...
New
Hi All,
I set a environment variables in dev.exs , like below code.
when i start server, how can i set the ${enable} value?
thanks.
d...
New
Hi,
I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
Other popular topics
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar.
I p...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










