Neo4j Cypher/provention shortestPath函数,用于检索不使用';t至少涉及一个遍历的关系

Neo4j Cypher/provention shortestPath函数,用于检索不使用';t至少涉及一个遍历的关系,neo4j,cypher,graph-databases,Neo4j,Cypher,Graph Databases,关于cyper请求的这一摘录: (假设元素是整个请求中的已知节点变量) 假设一个元素可能是用户,我如何防止在结果中检索表示用户本身的元素 如果我们能做到: MATCH p = shortestPath(element-[:LINKS*1..3]-(user)) RETURN length(p) 但它导致了这个错误: shortestPath(...) does not support a minimal length 实现这一技巧最有效的方法是什么?这个怎么样: MATCH p = shor

关于cyper请求的这一摘录: (假设
元素
是整个请求中的已知节点变量)

假设一个
元素
可能是
用户
,我如何防止在结果中检索表示用户本身的
元素

如果我们能做到:

MATCH p = shortestPath(element-[:LINKS*1..3]-(user))
RETURN length(p)
但它导致了这个错误:

shortestPath(...) does not support a minimal length
实现这一技巧最有效的方法是什么?

这个怎么样:

MATCH p = shortestPath((element)-[:LINKS*..3]-(user))
WHERE element <> user
RETURN length(p)
MATCH p=最短路径((元素)-[:LINKS*.3]-(用户))
WHERE元素用户
返回长度(p)
这个怎么样:

MATCH p = shortestPath((element)-[:LINKS*..3]-(user))
WHERE element <> user
RETURN length(p)
MATCH p=最短路径((元素)-[:LINKS*.3]-(用户))
WHERE元素用户
返回长度(p)
Cool,太简单了;)谢谢,这太简单了;)谢谢