Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-17-2022 11:18 AM
Hi!
I found from the documentation that the below syntax should work. However when I try it in neo4j browser, it gives me Neo.ClientError.Statement.SyntaxError. Is this syntax no longer supported by cypher? Thanks!
MATCH (n:Movie|Person)
RETURN n.name AS name, n.title AS title
#neo4j
Solved! Go to Solution.
12-17-2022 08:40 PM
The link is to the cypher 5.0 documentation. I could not find it in the 4.x documentation (the version can be selected from the drop down at the top left side of the window). I believe the ability to use an OR operator for label expressions for nodes was added in 5.0. It did exist for relationships types in 4.0. Maybe that is what you remember. The following is from the 5.0 release notes:
Improved label expressions in MATCH clauses.
Nodes and relationships can be filtered using more sophisticated label
and type boolean expressions such as & for logical AND (V:L1&L2),
| for logical OR (V:L1|L2), ! for negation (V:!L4), % for any (V:%)
and () for grouping (V:(L1&L2)|(L3& !L4)).
I also tested it in 5.0. It worked, but did not work in 4.4.10.
12-17-2022 08:40 PM
The link is to the cypher 5.0 documentation. I could not find it in the 4.x documentation (the version can be selected from the drop down at the top left side of the window). I believe the ability to use an OR operator for label expressions for nodes was added in 5.0. It did exist for relationships types in 4.0. Maybe that is what you remember. The following is from the 5.0 release notes:
Improved label expressions in MATCH clauses.
Nodes and relationships can be filtered using more sophisticated label
and type boolean expressions such as & for logical AND (V:L1&L2),
| for logical OR (V:L1|L2), ! for negation (V:!L4), % for any (V:%)
and () for grouping (V:(L1&L2)|(L3& !L4)).
I also tested it in 5.0. It worked, but did not work in 4.4.10.
12-18-2022 09:37 AM
This is indeed a new feature in v5
All the sessions of the conference are now available online