Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-03-2022 12:32 PM - edited 10-03-2022 01:44 PM
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
Solved! Go to Solution.
10-03-2022 01:51 PM - edited 10-03-2022 01:54 PM
Try this:
10-03-2022 01:51 PM - edited 10-03-2022 01:54 PM
Try this:
10-04-2022 09:29 PM
You're a miracle worker. Thank you so much!
10-04-2022 09:44 PM
Am glad of some help to you! Thanks for your appreciation.
All the sessions of the conference are now available online