I have a simple database with person and building nodes. The relationships between these are visits with an arrival time and departure time. To start, I am attempting to build a query that shows all the arrivals that started between two datetimes.
Here is my query so far
MATCH path=(e)-[r:VISITED]->(b)
where all(rel in relationships(path) where rel.Visit_Arrive_Time > datetime({year:2020,month:5,day:30,hour:10}) and rel.Visit_Arrive_Time > datetime({year:2020,month:5,day:30,hour:13}))
return e,b
However the result appears to show more nodes and relationship than I expect:
When I run the following I get a similar result:
MATCH path=(e)-[r:VISITED {Visit_Depart_Time:datetime("2020-05-10T18:05:34Z")}]->(b) return e,b,r
Though I am asking for a specific timestamp, I get all the relationships between the two nodes. Sage does have a visit with that arrival time. However I want only the single relationship.
I am pretty new to Neo4j so please excuse my newness. I am fairly sure that my lack is a core concept I need to review in the docs. Any input is appreciated.
Ultimately I would like to show any visit that occurred to the window between that time to a location. Then be able to show subsequent visits from those times forward.
- neo4j version: 4.0.2 Enterprise
- desktop version: 1.2.7.1676