Broken procedure apoc.neighbors.tohop

I realised that procedure apoc.neighbors.tohop is broken.
I tried it on the graph given in the following example and when distance parameter is higher that 1 it returns strange result, including starting node.

I tried example from the link above and after executing query

MATCH (p:Person {name: "Praveena"})
CALL apoc.neighbors.tohop(p, "FOLLOWS>", 2)
YIELD node
RETURN node

we get: {name: "Mark"} and {name: "Praveena"}
instead of: {name: "Mark"} and {name: "Joe"}

That seems to be a bug, can you please create a issue at Issues · neo4j-contrib/neo4j-apoc-procedures · GitHub

Done.

1 Like