我无法理解doc中的这个例子:
START david=node(1)
MATCH david--otherPerson-->()
WITH otherPerson, count(*) as foaf
WHERE foaf > 1
RETURN otherPerson
otherPerson 和 count(*) 在WITH行中做什么?
最佳答案
您在这里看到的是两个由 with 连接的查询。 With 充当第一个查询的返回和第二个查询的“开始”。 它设置了传递的上下文的一部分。
normally you would have
START david=node(1)
MATCH david--otherPerson-->()
RETURN otherPerson, count(*) as foaf
然后在调用代码中进行过滤。
with with可以直接在cypher中开始下一个查询,它只能看到with部分声明的内容, 在这种情况下: otherPerson 和 foaf 第一个查询的其他标识符和数据不再可用。
关于neo4j - Neo4j 中WITH 的作用是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10466999/