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?