【发布时间】:2016-02-12 20:31:50
【问题描述】:
我试图了解某些标识符或表达式对应于哪种密码“数据结构”,具体取决于它们的使用方式和位置。 下面我列出我遇到的例子。如果我做对了(在 cmets 中)或者我遗漏了什么,请告诉我。
MATCH (a:MYTYPE { label:'l_a' })
// a corresponds to a collection of nodes
MATCH (b:MYTYPE { label:'l_b' })
// so does b
MATCH p=(a)-[sp1:CF*]->(b)-[sp12:CF]->(c)
// p corresponds to a collection of paths
// a and b correspond to a collection of nodes
// (or does the previous MATCH of a and b change something?)
// sp1 corresponds to a collection of collections of relationships
// sp12 corresponds to a collection of relationships
// c corresponds to a collection of nodes
WHERE ( p = ... )
// Here, the p corresponds to a path, i.e. there must be a path or (I don't know) on the right side of the =
WHERE ( a = ... )
// a corresponds to a node, i.e. there must be a node on the right side of the =
WHERE ( sp1 = ... )
// sp1 corresponds to a collection of nodes, i.e. there must be a collection of relationships on the right side
//BONUS:
WHERE ( (e)-[sp2:CF*]->(f) ) = ...
// there must be a collection of collections of paths on the right side of the =
【问题讨论】:
-
在 ` p = ` 的右侧也必须是一条路径,但我不确定它们是否实现相等,如果没有,我会比较
nodes(p)或 @ 987654323@ -
我想当你说“a 是节点的集合”时你的意思是当你
RETURN a时你最终会在客户端中得到多行节点?否则,您的假设不正确,a和b之类的内容是每个返回行的单个节点。 -
迈克尔:是的,你的假设是正确的。我认为“以行结束”这一事实意味着返回的值是一个集合。但现在我意识到不是。
-
@MichaelHunger : 你会建议修改我不正确的问题还是留下这样的答案/cmets?