Hi,
I want to find the nearest neighbours with the same value of relationship property. Eg. the relationship PARENT has the property "color" and that property has values as "yellow", "green" and "red". So I want to find the the nearest neighbours only with the same color.
I have already wrtite some code, which work fine. But that code return nodes with mixed relationship colors.
Question: How to expand the code to implement thatt restriction ? Perhaps a for each construnt for each value of color ?
Thanks in advance,
Michel
THis question is related to How to get the first node from relationship with property value
match (p1:MAGIC{aprop:'xyz'})
CALL apoc.path.expandConfig(p1, {
relationshipFilter: "<PARENT",
labelFilter: "/MAGIC",limit:1
})
yield path1
SET p1.beforeprop = last(nodes(path1)).aprop
==========================================================
match (p2:MAGIC{aprop:'xyz'})
CALL apoc.path.expandConfig(p2, {
relationshipFilter: "PARENT>",
labelFilter: "/MAGIC",limit:1
})
yield path2
SET p2.afterprop = last(nodes(path2)).aprop