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?
Popular in Questions
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
Hi all,
Trying to get some more clarity over utc_datetime and naive_datetime for Ecto:
https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
Student & New to elixir. Nice language.
I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
Hey,
I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: )
Hello all, this is ...
New
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
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
Other popular topics
Hello, I get Persian date from my client and convert it to normal calendar like this:
def jalali_string_to_miladi_english_number(persi...
New
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Good day to you all.
I have been struggling to get a query involving like and ilike to work.
Can anyone assist me on this, please?
pro...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
Hi folks,
Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
New
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
I would like to know what is the best IDE for elixir development?
New
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New







