0

リンクの写真のようにノードが接続されています

クエリを実行しますSTART a=node(27), b=node(0) MATCH p=b<-[*]-a RETURN p

最初の 3 つは正しいですが、最後の 3 つは「ノード 0」が重複しています。

例えば:

正しいパス: 0 -> 41 -> 2 -> ... -> 27
重複ノード パス: 0 -> 0 -> 41 -> 2 -> 27

正しくないパスの長さは、正確に 1 ずつ増加します。

(この例では) 重複ノードなしで正確に 3 つのパスを取得するクエリを作成する方法は?

4

1 に答える 1

0

Your query is correct and there probably is a problem in the database. I replicated your graph structure: console.neo4j. Run START n=node(*) RETURN n to get the ids of node 27 and 0 and then run your query. It returns exactly 3 results.

To check whether you have loops on node 0 execute:

START n=node(0) MATCH n-[r]-n RETURN r
于 2014-02-21T10:22:31.750 に答える