Reputation: 912
it would be appreciated to if anyone can answer that is there any way to add an LOOP function to cypher? i can find loops in graph by use of traversal. but i want to know is there anyway to pass obtained result to a customized user defined Cypher function?
Upvotes: 2
Views: 1113
Reputation: 2240
It seems that you are asking two different questions.
About whether you can use loops in Cypher, yes you can, with FOREACH
or UNWIND
, depending on what you want to achieve. This is a good resource for when you don't quite know which is the right one for your case. It compares the two and tries them with different example queries.
As for whether you can write user defined function, as of Neo4j 3.0, you can. They are however written in Java. Look into this link for more details: https://neo4j.com/developer/procedures-functions/
Upvotes: 0
Reputation: 39925
Until UDFs are possible with Cypher, you might consider using unmanaged extensions.
Upvotes: 1
Reputation: 33165
Not yet. They're talking about UDFs (User Defined Functions) in an upcoming release of Neo4j, though. You might consider refining your use case and asking for it as a feature of Cypher itself in github issues, as well.
Upvotes: 2