Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-05-2021 03:21 PM
MATCH (n:Object)
MATCH (m:Object)
WHERE n.name = "A"
WHERE m.name = "B"
RETURN n,m
In the browser, complains of a syntax error: Unexpected "H" at line 4 column 2
Solved! Go to Solution.
01-05-2021 03:43 PM
MATCH (n:Object) WHERE n.name = "A"
MATCH (m:Object) WHERE m.name = "B"
RETURN n,m
OR
MATCH (n:Object {name: "A"})
MATCH (m:Object {name: "B"})
RETURN n,m
OR
MATCH (n:Object {name: "A"}), (m:Object {name: "B"})
RETURN n,m
OR
MATCH (o:Object) WHERE o.name IN ["A","B"]
RETURN o
WHERE is not a clause but a subclause, it must follow directly its associated match or optional match. In your case WHERE n.name = "A" doesn't follow directly its MATCH (n:Object) clause.
01-05-2021 03:43 PM
MATCH (n:Object) WHERE n.name = "A"
MATCH (m:Object) WHERE m.name = "B"
RETURN n,m
OR
MATCH (n:Object {name: "A"})
MATCH (m:Object {name: "B"})
RETURN n,m
OR
MATCH (n:Object {name: "A"}), (m:Object {name: "B"})
RETURN n,m
OR
MATCH (o:Object) WHERE o.name IN ["A","B"]
RETURN o
WHERE is not a clause but a subclause, it must follow directly its associated match or optional match. In your case WHERE n.name = "A" doesn't follow directly its MATCH (n:Object) clause.
All the sessions of the conference are now available online