Skip to content

Instantly share code, notes, and snippets.

@LeonardoMarrancone
Created July 14, 2020 15:41
Show Gist options
  • Save LeonardoMarrancone/1da927aa9e40a3affa87d31faa0ecbb9 to your computer and use it in GitHub Desktop.
Save LeonardoMarrancone/1da927aa9e40a3affa87d31faa0ecbb9 to your computer and use it in GitHub Desktop.
Query to import relationship WATCH
LOAD CSV FROM 'file:///shows.csv' AS row
WITH row, toInteger(row[0]) as id, row[1] as labels, row[2] as follows, row[3] as name, row[4] as surname, toInteger(row[5]) as start, toInteger(row[6]) as end, row[7] as type, toFloat(row[8]) as rating
WHERE type="WATCH"
MATCH (u:User) WHERE u.id= start
MATCH (s:Show) WHERE s.id= end
CREATE (u)-[:WATCH{rating: rating}]->(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment