首页 > 解决方案 > 是否可以使用 apoc.path.spanningTree() 中的属性过滤关系?

问题描述

我需要从节点获取生成树。关系具有数字 update_time 属性。生成树应该只包含最近的关系(update_time >= period_start)。我尝试使用 apoc.path 程序,但似乎它们不允许根据关系属性进行过滤,只能根据关系类型进行过滤。

是否可以使用关系属性运行 apoc.path.spanningTree() ,如果没有,那么最佳解决方案是什么?

MATCH (user:User {id: 555})
CALL apoc.path.spanningTree(user, {
    limit: 10000, 
    maxDepth:7, 
    labelFilter:"User",
    relationshipFilter:"CONNECTED" // need to filter by update_time here
}) YIELD path
RETURN path;

标签: neo4jcypherneo4j-apocspanning-tree

解决方案


推荐阅读