Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Neo4j p已声明错误_Neo4j_Cypher - Fatal编程技术网

Neo4j p已声明错误

Neo4j p已声明错误,neo4j,cypher,Neo4j,Cypher,我正在运行以下查询: START root=node:people(id="$personOrFamilyId"), descendant=node:people(id="$descendant") MATCH p=shortestPath(root-[p:child|descendant*..25]->descendant) RETURN EXTRACT( n in nodes(p) : n.id ) as node_ids_on_path 并获得以下错误: p already d

我正在运行以下查询:

START root=node:people(id="$personOrFamilyId"), descendant=node:people(id="$descendant") 
MATCH p=shortestPath(root-[p:child|descendant*..25]->descendant) 
RETURN EXTRACT( n in nodes(p) : n.id ) as node_ids_on_path
并获得以下错误:

p already declared

它在1.9中运行,但在2.0中失败了。我遗漏了什么?

您正在对来自最短路径的路径以及模式内部的关系标识符重用标识符
p

START root=node:people(id="$personOrFamilyId"), descendant=node:people(id="$descendant") 
MATCH p=shortestPath(root-[:child|descendant*..25]->descendant) 
RETURN EXTRACT( n in nodes(p) | n.id ) as node_ids_on_path
现在我明白了:提取(…)需要“|表达式”(提取表达式)啊,的确如此。遗漏了这一点——提取函数现在需要一个管道。