cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Can't import csv to neo4j

Hi,

I run query to save relationship but it shows (no changes, no records). the location_id and weather_id are both not null. Location and Weather nodes are fine. What did i do wrong here?

Thank you for your help!

 

maidh_0-1661027317015.png

 

maidh_2-1661027524151.png

maidh_3-1661027540363.png

maidh_4-1661027583068.png

 

 

 

1 ACCEPTED SOLUTION

glilienfield
Ninja
Ninja

Are your location_id and weather_id properties stored as integers? If so, you need to conver both line.location_id and line.weather_id to integers to get the match to work. The reason is because every value is imported as a string. Use the toInteger() to convert each. 

https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tointeger

you can also see if the match is returning something in the subquery if your return something from the subquery. Add ‘return 1 as test’ at the end of the subquery.  It will return null if the match doesn’t return a result and the outer query will return nothing for that row as well. After making the adjustment and if you get no output the match is not matching for those lines. 

View solution in original post

2 REPLIES 2

glilienfield
Ninja
Ninja

Are your location_id and weather_id properties stored as integers? If so, you need to conver both line.location_id and line.weather_id to integers to get the match to work. The reason is because every value is imported as a string. Use the toInteger() to convert each. 

https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tointeger

you can also see if the match is returning something in the subquery if your return something from the subquery. Add ‘return 1 as test’ at the end of the subquery.  It will return null if the match doesn’t return a result and the outer query will return nothing for that row as well. After making the adjustment and if you get no output the match is not matching for those lines. 

Thank you so much! It works well now