neo4j - Checking NULLS in an OPTIONAL MATCH -
i have cypher query this:
match (start:startlabel) optional match (start)-[:a]->(end1:endlabel) optional match (start)-[:b|c]->(middle:middlelabel)-[:d]->(end2:endlabel) not(end1 null , end2 null) return *
in graph model there multiple valid ways reach (end)
(start)
want make sure result matches @ least 1 of possible optional match
paths. reason continue results both end1
, end2
null
where
clause. missing how cypher processes optional match
, where
together?
here alternate way results:
match (start:startlabel)-[:a]->(end:endlabel) return start, null middle, end union match (start:startlabel)-[:b|c]->(middle:middlelabel)-[:d]->(end:endlabel) return start, middle, end
Comments
Post a Comment