Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-21-2021 11:44 AM
My query that I had for sometime seems to be deprecated (it works though but eventually might not) and want to know how I can get the same output with the right query. Here is my query
MATCH (root:Person {lns_neo4j_id:'9'})-[lns_relationship*1..3]->(a:Person) UNWIND lns_relationship AS rs RETURN DISTINCT startNode(rs) as Person, rs as Relationship, endNode(rs) as RelatedPerson Order by startNode(rs).lns_neo4j_id
Any suggestions please.
03-22-2021 05:01 AM
Hello @rangan and welcome to the Community!
What version of Neo4j database are you using?
What is the content of the deprecation warning that you are seeing?
Elaine
03-22-2021 06:14 AM
The version is 4.2 and the error/warning is as follows:
Binding relationships to a list in a variable length pattern is deprecated.
(Binding a variable length relationship pattern to a variable ('lns_relationship') is deprecated
and will be unsupported in a future version. Appreciate your feedback
Thanks
Bye
03-22-2021 07:28 AM
Here is what engineering recommends:
Use relationships()
function on a path - MATCH - Neo4j Cypher Manual
Elaine
03-25-2021 01:37 AM
@rangan You can use the apoc.convert.toTree to get the associated nodes. Below is the link which might help you.
Thanks
All the sessions of the conference are now available online