Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-07-2021 11:16 AM
Hello, I have a Json file that is composed by a json object per line (as a result of pandas.to_json()
)
{json obj 1}
{json obj 2}
{json obj 3}
{json obj 4}
The problem is that when I send this object through a parameter, using the Neo4j python driver, I get a new line char "\n" on the other side, separating the objects inside the list:
[{json obj 1}\n{json obj 2}\n{json obj 3}\n{json obj 4}]
Is there a way to iterate this with cypher? I tested by importing the files, and it worked. Now, the GOAL is using a parameter but I'm not getting there.
I'm sharing the test code ,for importing the file, that works:
QUERY_STATION_TEST = """CALL apoc.load.json("file:///stations.json")
YIELD value
MERGE (n:Station{SNIRH:value.SNIRH})
SET n += value
RETURN count(n)
"""
Solved! Go to Solution.
02-07-2021 02:06 PM
SOLUTION
Instead using pandas.to_json() I solved the problem using pandas._to_dict(). It already does the job properly
02-07-2021 02:06 PM
SOLUTION
Instead using pandas.to_json() I solved the problem using pandas._to_dict(). It already does the job properly
All the sessions of the conference are now available online