Search code examples
neo4jcypherjava-stored-procedures

How do I ignore the yield value from a java stored procedure in cypher (neo4j)?


I have a CYPHER statement which first nearly matches every node in my graph.

MATCH (n:node) CALL procedure(n) YIELD node RETURN node

This blows up my memory (within python) because the response is so large. If I don't need or want the yielded value of the procedure, is it possible to tell neo4j using cypher not to return it?

When I try things like YIELD NULL RETURN NULL or similar variations, I get errors.


Solution

  • With my experience with Neo4J stored procedures, you must acknowledge the YIELD of the procedure, but you don't necessarily have to use it. For example:

    MATCH (n:node) CALL procedure(n) YIELD node return null limit 1;
    

    The limit 1 is to prevent a null from being returned for however many results are returned by the procedure.