Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-04-2022 04:01 AM
I have a query that does what I want.
Yet, it runs with warnings, but when I'm trying to adjust it to the new syntax, it doesn't work (the result is different).
Why? What am I doing wrong?
match (g:Id {start_marker: 1})-[MINST*]->(leaf)
where not (leaf)-[:MINST]->()
return leaf
Binding a variable length relationship pattern to a variable ('rel') is deprecated and will be unsupported in a future version. The recommended way is to bind the whole path to a variable, then extract the relationships: MATCH p = (...)-[...]-(...) WITH *, relationships(p) AS rel
match p = (g:Id {start_marker: 1})-[MINST]->(leaf)
with *, relationships(p) as MINST
where not (leaf)-[:MINST]->()
return leaf
Solved! Go to Solution.
03-04-2022 07:20 AM
First, I feel you are missing a ":" in the relationship part in the path. Because of that it is going to give all relationships.
Also for other aspect you might have to add EXISTS
Can you try this?
match p = (g:Id {start_marker: 1})-[:MINST*]->(leaf)
where not EXISTS ((leaf)-[:MINST]->())
return leaf
03-04-2022 07:20 AM
First, I feel you are missing a ":" in the relationship part in the path. Because of that it is going to give all relationships.
Also for other aspect you might have to add EXISTS
Can you try this?
match p = (g:Id {start_marker: 1})-[:MINST*]->(leaf)
where not EXISTS ((leaf)-[:MINST]->())
return leaf
All the sessions of the conference are now available online