MATCH (n {name: "Occ82"})
CALL apoc.cypher.run("MATCH (m) WHERE "+apoc.text.join([label IN labels(n) | "m:"+label], " OR ")+" RETURN m", {})
YIELD value
RETURN value
i want to do a match on a dynamic relationship type
match ( u:RevisionRule)
with u.name as revrule
revrule return "Latest Working" . it has space.
whei i execute below
match ( u:RevisionRule)
with u.name as revrule
call apoc.cypher.run ( "match ( o:Occurrence ) - [r:"+revrule+"] ->(p:ProductRevision) return o ,p", {} ) yield value
with value , revrule
with revrule, value.o as o , apoc.text.split( value.o.occurrenceRefs, " ") as childOccurrence , value.p as p
unwind childOccurrence as child
return child, p , o
If you have a space in a relationship type or a node label then you must use a single quote:
MATCH (u:RevisionRule)
WITH u.name AS revrule
CALL apoc.cypher.run("MATCH (o:Occurrence)-[r:`"+revrule+"`]->(p:ProductRevision) RETURN o, p", {})
YIELD value
WITH value, revrule
WITH revrule, value.o AS o, apoc.text.split(value.o.occurrenceRefs, " ") AS childOccurrence, value.p AS p
UNWIND childOccurrence AS child
RETURN child, p, o