如何在neo4j中搜索多个节点

时间:2015-05-10 19:51:50

标签: neo4j

我正在尝试匹配多个节点,但我无法创建正确的查询。

此查询适用于david,但如何在david之后添加其他名称?比如约翰?

Match (p:People {peopleName:"david"})-[:PEOPLE_ASSOCIATED_PLACE]-(pl:Place)-[:PLACE_ASSOCIATED_EVENT]-(e:Event)  
return p.peopleName, pl.placeName, e.eventTitle, e.eventDate order by e.eventDate desc

1 个答案:

答案 0 :(得分:1)

我认为您只需要像SQL

一样使用WHERE子句
MATCH (p:People)-[:PEOPLE_ASSOCIATED_PLACE]-(pl:Place)-[:PLACE_ASSOCIATED_EVENT]-(e:Event) 
WHERE p.peopleName in ["david", "John"]
RETURN p.peopleName, pl.placeName, e.eventTitle, e.eventDate order by e.eventDate desc