Reputation: 484
I used the following code from Rik's book (page 105):
However, I got the following syntax error:
I assume the symbols quoting Relationship Type is the backtick `
May I ask how to correct the syntax errors here?
Upvotes: 0
Views: 42
Reputation: 359
Try to add parentheses like that :
CREATE (from)-[:REL {type:rels.`Relationship type`}]->(to)
Before v3.0, parentheses in patterns were not mandatory, now they are.
Upvotes: 1
Reputation: 16375
This is probably only a typo error in the book or maybe an old-syntax style. You should put parenthesis in from
and to
variables:
load csv with headers from "file:/your/path/to/rels.csv"
as rels
match (from {id: rels.From}), (to {id: rels.To})
create (from)-[:REL {type: rels.`Relationship Type`}]->(to)
return from, to
Upvotes: 2