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.