本文介绍了Neo4j-通过多种关系类型进行匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过多种关系类型在实体之间进行匹配.
I want to match between entities by multiple relationship types.
是否可以说以下查询:
match (Yoav:Person{name:"Yoav"})-[:liked & watched & ... ]->(movie:Movie) return movie
我在所有关系类型之间都需要和";约瓦(Yova)喜欢看电影并看电影.
I need "and" between all the relation types; Yova liked and watched and .. a movie.
推荐答案
是的,您可以执行以下操作:
Yes, you can do something like:
match (gal:Person{name:"Yoav"})-[:liked|:watched|:other]->(movie:Movie)
return movie
看看文档:匹配多种关系类型
从评论中:
在这种情况下,您可以执行以下操作:
In this case, you can do:
match (Yoav:Person{name:"Yoav"})-[:liked]->(movie:Movie),
(Yoav)-[:watched]->(movie),
(Yoav)-[:other]->(movie)
return movie
这篇关于Neo4j-通过多种关系类型进行匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!