Papillon6814
Convert charlist to string recursively
Hello. I need help from you
![]()
First of all, I have a return value from the neo4j database like this:
%{
'records' => [
%{
'category' => 'NODE',
'id' => 83,
'key' => 'm',
'labels' => ['Match'],
'properties' => %{'bracket_id' => 1, 'depth' => 1}
}
],
'results' => %{
'm' => %{
'category' => 'NODE',
'id' => 83,
'key' => 'm',
'labels' => ['Match'],
'properties' => %{'bracket_id' => 1, 'depth' => 1}
}
}
}
The type of keys and values are charlist, not string(sometimes the value is integer though). I’d like to convert those charlist keys and values into string all!
Then, the data I want is like this:
%{
"records" => [
%{
"category" => "NODE",
"id" => 83,
"key" => "m",
"labels" => ["Match"],
"properties" => %{"bracket_id" => 1, "depth" => 1}
}
],
"results" => %{
"m" => %{
"category" => "NODE",
"id" => 83,
"key" => "m",
"labels" => ["Match"],
"properties" => %{"bracket_id" => 1, "depth" => 1}
}
}
}
I think I have to make a function that converts charlist into string recursively, but I don’t have an implementation idea. Because I’d like to convert only charlist, not all list. Please help me if you have a solution for it. Thank you.
First Post!
hauleth
How you want to differentiate between [42] and '*'? Maybe look for another Neo4j driver that would use binaries instead of charlists?
0
Most Liked
Sebb
Popular in Questions
Hi,
I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
I would like to know what is the best IDE for elixir development?
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 have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
Hello all!
I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors:
[WARN] - (starship::utils): Executing command ...
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
Other popular topics
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set?
Thanks.
New
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
New
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
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









