Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-06-2019 01:18 AM
I have a dynamic hierarchy of nodes & relations and want to extract max of a Node (p) associated in that hirerchy . Snippet of hierarchies is as under
EG:-p1<-p2<-p4<-p5
p1<-p2<-p4<-p6
p1<-p3<-p7<-p8
p1<-p3<-p7<-p9
I have a node c..n having relationship with each of pn nodes , I need to get maximum of property of the c..n node in each pth mentioned above.
I am using -[:has_relation*]- to traverse the tree , but moment i specify p1.property1=67 and pn.property=100 , i get a single row.
I need all rows corresponding to the path and maximum of property associated with each subnode.
each Subnode:-
(pn)-[:has_other_relation]->(c_node_n)
Is it possible to get this in Neo4j ?
Have thought of using FOREACH, but its used for merging/creating new relation/property not returning anything.
09-06-2019 04:07 AM
Usually you can use a path expression:
like this:
MATCH path (r:Node {id:root})-[:HAS_CHILD*]->(c) WHERE not (c)-[:HAS_CHILD]->()
RETURN path
or the other way round if you want to start at the child
All the sessions of the conference are now available online