[英]cypher query to match all nodes of a specific relationship type to a specific node
I have a node type of Author
and a node type of Articles
我有
Author
节点类型和Articles
节点类型
Author
has a relationship type of WROTE
which links it to articles that it has written. Author
有一个WROTE
关系类型,它将它链接到它所写的文章。
I would like to get all articles that have been written by an author with a specific uuid.我想获取具有特定 uuid 的作者所写的所有文章。
MATCH (n:Author {uuid: '8f47fb1d-2a3f-46a8-b0fc-06b24169ac86'})<-[:WROTE]-(Article) RETURN Article
is what I am trying, but it is coming back with (no changes, no records)
是我正在尝试的,但它回来了
(no changes, no records)
I'm guessing here, but the direction of your relationship seems off.我在这里猜测,但你们关系的方向似乎不对。 You also want to provide the type (ie "label") of your article node:
您还想提供文章节点的类型(即“标签”):
MATCH (n:Author {uuid: '8f47fb1d-2a3f-46a8-b0fc-06b24169ac86'})-[:WROTE]->(a:Article)
RETURN a
For exploring your data and if you do not know the direction, you can match relationships while ignoring the direction:为了探索你的数据,如果你不知道方向,你可以在忽略方向的情况下匹配关系:
MATCH (n:Author {uuid: '8f47fb1d-2a3f-46a8-b0fc-06b24169ac86'})-[:WROTE]-(a:Article)
RETURN a
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.