我错过了什么! Timetree查询不起作用

时间:2016-03-05 14:11:49

标签: neo4j cypher

MATCH startPath = (event:RESERVATION)-[]->(sd:DAY)<-[:`5`]-(sm:MONTH)<-[:`1`]-(sy:YEAR)<-[:`2016`]-(room:ROOM)
WHERE event.reservationId = 44
RETURN startPath

MATCH endPath   = (event:RESERVATION)-[]->(ed:DAY)<-[:`6`]-(em:MONTH)<-[:`1`]-(ey:YEAR)<-[:`2016`]-(room:ROOM)
    WHERE event.reservationId = 44
    RETURN endPath

都返回有效路径,但组合为

MATCH startPath = (event:RESERVATION)-[]->(sd:DAY)<-[:`5`]-(sm:MONTH)<-[:`1`]-(sy:YEAR)<-[:`2016`]-(room:ROOM),
      endPath   = (event:RESERVATION)-[]->(ed:DAY)<-[:`6`]-(em:MONTH)<-[:`1`]-(ey:YEAR)<-[:`2016`]-(room:ROOM)
WHERE event.reservationId = 44
RETURN startPath, endPath

不返回任何行! 我错过了什么?

1 个答案:

答案 0 :(得分:0)

最后一个查询要求startPathendPath以相同的ROOM节点结束(因为它们都使用相同的room标识符)。您的数据可能没有这样的节点。