Hi All!
I'm attempting to identify a way to create a relationship between two nodes, based on the value of one of their properties. If I was to psuedo-code talk it out, it might be something like this:
match the node (n:asset) with a transaction id of "12345" and a secondProperty value of 0
Also, match the node (n:asset) with a transaction id of "12345", that has a secondProperty value that is the largest value of all nodes that have a transaction id of "12345"
Creation a relationship [:relationship] between these two nodes
.... my messy version might be something like:
match (n:asset {transactionId: "12345" , secondProperty: 0})
match (m:asset {transactionId: "12345") where secondProperty = max(secondProperty.value)
create (n)-[r:RELATIONSHIP]->(m)
return n,r,m
I know this is wrong but could use some help righting the ship? Any thoughts? I've attempted using the apoc.agg.maxItems function, but I have difficulty following the examples and documentation.
-Isaac