Head's Up! Site migration is underway. Phase 2: migrate recent content
β12-06-2022 11:34 PM
I'm loading data from a csv file and when I see an already existing edge attribute, then I want to pass that already existing edge attribute else it'll be blank. I'm getting the following when trying to run this cypher query ...
Cypher query
LOAD CSV WITH HEADERS FROM $csv_file_path AS line
// FOR UPDATING QUANTITY DATA
MATCH (d:Diagnosis)
WHERE d.diagnosis_id=line.diagnosisID
MERGE (t:Treatment {treatment_id:line.treatmentID})
MERGE (d)-[r:DiagnosisToTreatment]-(t)
WITH apoc.convert.fromJsonMap(replace(CASE WHEN EXISTS r.qty_dict THEN r.qty_dict ELSE {} END, '`', '')) as map, apoc.convert.fromJsonMap(replace(line.qty_dict, '`', '')) as map1
............
The error I'm getting is:
Query failed: {code: Neo.ClientError.Statement.SyntaxError} {message: Invalid input 'r': expected
Solved! Go to Solution.
β12-07-2022 06:19 AM
Instead of βexistsβ try βis not nullβ also, does the else value have to be a string, I.e. β{}β ?
β12-07-2022 06:19 AM
Instead of βexistsβ try βis not nullβ also, does the else value have to be a string, I.e. β{}β ?
β12-07-2022 06:30 AM
Thanks
All the sessions of the conference are now available online