Search code examples
c#neo4jcypherneo4j-apoc

Where can I find more detailed help about apoc relationShipFilter in Neo4j


I used some apoc funtions (thx to InversFalcon). And I found some helpful information on this site

But the relationShipFilter is just used in some function, but never explain detailed :)

There is some example, but not the full syntax. I want to exclude a relation, and I hope there is a syntax for it.

Here is a code, where I want to use it:

                IStatementResult result = session.Run(
                $"         MATCH (g:Graph)                                     \n" +
                $"         WHERE g.Database = '{Name}'                         \n" +
                $"           AND g.Name     = '{graph.Name}'                   \n" +
                $"          CALL apoc.path.subgraphNodes( g, {{ }}) YIELD node \n" +
                $" DETACH DELETE node                                          \n" );

And the apoc.path.subgraphNodes takes a parameter relationshipFilter.


Solution

  • Relationship syntax and examples are here, but there currently isn't a means to exclude relationships.

    Instead you would need to get all relationship types in the graph, filter out those you don't want, and join the remaining types into a string that you can pass to the filter, as mentioned in this answer to a similar question.