it work perfectly but i have a case that the start and end is the same node.
what i want is to return the node in this case, is it possible ? i tried minLevel:0 but it doesn't return the node
I have an another possibility :
MATCH (from), (to)
CALL apoc.algo.allSimplePaths(from, to, 'A|B>', 10)
YIELD path
RETURN path
This one work good, even with the case of from = to but i cannot filter the labels node like the first request (labelFilter: "-C").
My question is :
how can i get the only for the first request the start node if the start = end,
or, for the seconde how i can filter the labels ?
CALL apoc.path.expandConfig(start, {
relationshipFilter: "A|B>",
labelFilter: "-C",
maxLevel: 6,
minLevel: 1,
uniqueness: 'NODE_PATH',
endNodes:[end]}) YIELD path
WITH path, start
unwind CASE WHEN length(path) IS NULL THEN [start] ELSE nodes(path) END as n
...
i don't know if we can configure apoc.path.expandConfig to return simple node
To answer your first question on apoc.path.expandConfig(), filtering isn't applied to start nodes by default, which is why your start node isn't returned as a result. You can toggle this on by adding filterStartNode:true in the config parameter map.
The documentation on that one could use an update. It specifically mentions label filters, and those predated the node filters (where we pass in the endNodes or terminatorNodes). Though not mentioned, the filterStarNode config property also applies to them.