那你怎么or
条件and
呢?下面的例子:
START user = node({id})
MATCH
(user)-[:follows]->(followed),
(follower)-[:follows]->(user)
RETURN user, followed, follower
我想得到的是:user
,无论是否有人关注她或她是否关注任何人。全部followers
,如果有的话。如果有的followed
话。
上面的查询就像一个and
. 如果 ifuser
没有关注任何人,或者没有人关注用户,则不返回任何内容。
这是我尝试过的其他方法,但出现语法错误:
start a = node(40663)
with a, a as b
match (b)-[:follows]->(c)
with b, a as d
(e)-[:follows]->(d)
return a, c, e;
错误:
SyntaxException: string matching regex `$' expected but `(' found
Think we should have better error message here? Help us by sending this query to cypher@neo4j.org.
Thank you, the Neo4j Team.
"start a = node(40663) with a, a as b match (b)-[:follows]->(c) with b, a as d (e)-[:follows]->(d) return a, c, e"
^
不管这个错误如何,减少的查询(只有一个with
)返回零结果,所以这似乎也不是这样做的方法。