3
我試着寫在創建節點的關係鏈,通過一定的條件進行排序neo4j
暗號語言查詢的連續元素之間的關係。創建列表
例如。我有這個疑問:
MATCH (n)
WHERE n.some_property = 'something'
WITH n
ORDER BY n.some_other_property
WITH collect(n) as node_list
我需要的node_list
的每一個元素與列表中的下一個元素聯繫起來。
例如,如果node_list
包含:
[a, b, c, d, e]
結果將是: CREATE (a)->[:rel]->(b)->[:rel]->(c)->[:rel]->(d)->[:rel]->(e)
所以最終的查詢將是:
MATCH (n)
WHERE n.some_property = 'something'
WITH n
ORDER BY n.some_other_property
WITH collect(n) as node_list
CREATE LINKS OF CONSECUTIVE node_list
有沒有辦法做到它?