为什么 Tom Hanks 在这个密码查询中没有返回? [英] Why isnt Tom Hanks returned in this cypher query?

查看:20
本文介绍了为什么 Tom Hanks 在这个密码查询中没有返回?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 Neo4j 电影介绍中运行时

When running this from the Neo4j movie intro

MATCH (tom:Person {name:"Tom Hanks"})-[:ACTED_IN]->(m)<-[:ACTED_IN]-(coActors) RETURN coActors.name

我期待让汤姆汉克斯"回来,因为他也匹配匹配子句的右侧".

I was expecting to get "Tom Hanks" back since he also matches the "right side" of the match clause.

为什么左边匹配的节点右边不匹配?

How come a node matched on left side not matches on the right side?

推荐答案

在单个模式中多次匹配的关系将不包括在内.左侧的 (tom)-[:ACTED_IN]->(m) 匹配从 Tom Hanks 到电影的 ACTED_IN 关系.此关系不会在右侧再次匹配.

Relationships that are matched multiple times in a single pattern will not be included. (tom)-[:ACTED_IN]->(m) on the left matches the ACTED_IN relationship from Tom Hanks to the movie. This relationship will not be matched again on the right hand side.

Neo4j 手册中的更多示例 - http://neo4j.com/docs/stable/cypherdoc-uniqueness.html

Some more examples of this in the Neo4j Manual- http://neo4j.com/docs/stable/cypherdoc-uniqueness.html

这篇关于为什么 Tom Hanks 在这个密码查询中没有返回?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆