Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-20-2022 01:38 PM
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!
Solved! Go to Solution.
08-20-2022 02:34 PM - edited 08-20-2022 03:04 PM
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.
08-20-2022 02:34 PM - edited 08-20-2022 03:04 PM
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.
08-20-2022 02:51 PM
Thank you so much! It works well now
All the sessions of the conference are now available online