繁体   English   中英

Neo4j Cypher查询多个关系的属性

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM