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
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
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
Hi! May someone helps me, please!
I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
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 am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
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
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
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Other popular topics
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
Credo is smart enough to check for (something like) this:
assert length(the_list) == 0
with this response:
Checking if an enum is empt...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
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
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
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







