![](/img/trans.png)
[英]Neo4j cypher query: AllShortestPaths with specified nodes and relationship properties
[英]Neo4j Cypher Query on multiple relationship's properties
我使用屬性Expirydate
更新了關系。 我想在遍歷路徑中排除所有過期的關系。 查詢條件是通過路徑中的所有關系檢查Expirydate
。 我得到了錯誤:
==> SyntaxException:==> ==>認為我們應該在這里有更好的錯誤消息? 將此查詢發送到cypher@neo4j.org,可以為我們提供幫助。
這是查詢:
START sNode=node(530)
MATCH sNode-[r:hasRegisteredPlate|inHouseHoldWith*1..2]->eNode
WHERE eNode.NodeType = "Plate" and (rel in r:(not has(rel.ExpiryDate) or
(has(rel.ExpiryDate) and (rel.ExpiryDate<>'' or rel.ExpiryDate >'2013-10-04'))))
RETURN eNode LIMIT 20
任何幫助深表感謝
您可以嘗試使用謂詞all
。
START sNode=node(530)
MATCH sNode-[r:hasRegisteredPlate|inHouseHoldWith*1..2]->eNode
WHERE eNode.NodeType = "Plate" and all(rel in r
WHERE (not(has(rel.ExpiryDate)) or (has(rel.ExpiryDate) and (rel.ExpiryDate<>'' or rel.ExpiryDate>'2013-10-04')))
)
RETURN eNode LIMIT 20
您也可以嘗試反向
WHERE eNode.NodeType = "Plate" and none(rel in r
WHERE (has(rel.ExpiryDate) and rel.ExpiryDate<'2013-10-04')
)
請注意,我還沒有嘗試過這些,如果它們不起作用,也許您可以在neo4j控制台中設置示例圖。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.