I have a graph database where Airports are connected with each other by Flights using relations :ORIGIN and :DESTINATION. To each flight there's a ticket connected by relation :ASSIGN. The price is saved on a ticket.
Now I need to find all paths starting in Airport LAX, but with price less than 3000. I was able to find all paths, but I don't know how to connect a tickets to it.
My query for finding paths:
MATCH (origin:Airport { name:"LAX" }),(destination:Airport)
WITH origin,destination
MATCH path = (origin)-[r*..5]-(destination)
RETURN path
One path that is returned from that query:
[{"name":"LAX"},{},{"date":"11/29/2015 15:18:22","duration":269,"dista nce":2611,"airline":"19977"},{"date":"11/29/2015 15:18:22","duration": 269,"distance":2611,"airline":"19977"},{},{"name":"BOS"},{"name":"BOS" },{},{"date":"11/29/2015 01:20:17","duration":289,"distance":2704,"air line":"19977"},{"date":"11/29/2015 01:20:17","duration":289,"distance" :2704,"airline":"19977"},{},{"name":"SFO"}]
How to assign ticket to it and make a where to have only those with price less than 3000?