2013-12-21 61 views
0

我運行下面的查詢:p已經宣告錯誤

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它的失敗。我錯過了什麼?

回答

1

對於來自shortestPath的路徑以及模式內部的關係標識符,您正在重複使用標識符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 
+0

現在我得到:extract(...)require'|表達'(提取表達式) –

+0

啊,的確如此。錯過了 - 提取功能現在需要一個管道。 –