Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-26-2019 07:23 AM
I tried to do it
WITH apoc.convert.fromJsonMap(
'
[
{"id": "1", "parentid": "2",
"animal":
{
"cat": ["One", "Two"],
"dog": []
}
},
{"id": "3", "parentid": "4",
"animal":
{
"cat": ["Tt", ""],
"dog": ["ss"]
}
}
]
'
) as v return v
There is the error:
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke function apoc.convert.fromJsonMap
: Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.LinkedHashMap
out of START_ARRAY token
But, it works:
WITH apoc.convert.fromJsonMap(
'
{"id": "1", "parentid": "2",
"animal":
{
"cat": ["One", "Two"],
"dog": []
}
}
'
) as v return v
How could it be fixed?
Solved! Go to Solution.
09-26-2019 08:18 AM
The JSON fragment you have there is a JSON list, not a JSON map (notice the outermost square brackets). Use apoc.convert.fromJsonList()
09-26-2019 08:18 AM
The JSON fragment you have there is a JSON list, not a JSON map (notice the outermost square brackets). Use apoc.convert.fromJsonList()
All the sessions of the conference are now available online