Hi.
I am using following query to delete the following this of a node,
1. Its incoming and outgoing relationships
2. Outgoing nodes
3. itself
4. Return outgoing nodes ids
START n=node:stylesheetid(stylesheetid={0}) MATCH n-[rels*1..]->p WITH n,
rels, p, collect(p.availableImages) as photosid
FOREACH(rel IN rels: DELETE rel) DELETE p
WITH n, photosid MATCH n<-[r]-() DELETE n, r
RETURN DISTINCT photosid
However, this doesn't work in case of no outgoing relationships, as first
MATCH fails, any other way of achieving this functionality in same query.
Kindly let me know your suggestions on this.
Thanks,
Abdul